big

package module
v0.0.0-...-b204c9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2021 License: BSD-3-Clause Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Float

type Float struct {
	A, B *big.Float
}

Float is an imaginary number

func NewFloat

func NewFloat(a, b *big.Float) *Float

NewFloat creates a new imaginary number

func (*Float) Abs

func (f *Float) Abs(a *Float) *Float

Abs computes the absolute value of a

func (*Float) Add

func (f *Float) Add(a, b *Float) *Float

Add add two imaginary numbers

func (*Float) Arg

func (f *Float) Arg(x *Float) *Float

Arg computes arg(x + yi) = tan-1(y/x) https://mathworld.wolfram.com/ComplexArgument.html

func (*Float) Atan2

func (f *Float) Atan2(x *Float) *Float

Atan2 computes atan2 of x https://en.wikipedia.org/wiki/Atan2

func (*Float) Conj

func (f *Float) Conj(a *Float) *Float

Conj computes the complex conjugate of a

func (*Float) Cos

func (f *Float) Cos(x *Float) *Float

Cos computes cosine of a number https://www.wolframalpha.com/input/?i=cos%28x+%2B+yi%29

func (*Float) Div

func (f *Float) Div(a, b *Float) *Float

Div divides two imaginary numbers

func (*Float) Exp

func (f *Float) Exp(x *Float) *Float

Exp computes e^x for a complex number https://www.wolframalpha.com/input/?i=e%5E%28x+%2B+yi%29

func (*Float) Log

func (f *Float) Log(x *Float) *Float

Log computes the natural log of x https://en.wikipedia.org/wiki/Complex_logarithm

func (*Float) Mul

func (f *Float) Mul(a, b *Float) *Float

Mul multiples two imaginary numbers

func (*Float) Pow

func (f *Float) Pow(x *Float, y *Float) *Float

Pow computes x**y https://mathworld.wolfram.com/ComplexExponentiation.html

func (*Float) Rat

func (f *Float) Rat(r *Rational)

Rat stores the float in a rational

func (*Float) SetRat

func (f *Float) SetRat(r *Rational)

SetRat sets the value to a rational

func (*Float) Sin

func (f *Float) Sin(x *Float) *Float

Sin computes sine of a number https://www.wolframalpha.com/input/?i=sin%28x+%2B+yi%29

func (*Float) Sqrt

func (f *Float) Sqrt(a *Float) *Float

Sqrt computes the square root of the complex number https://www.johndcook.com/blog/2020/06/09/complex-square-root/

func (*Float) String

func (f *Float) String() string

String returns a string of the imaginary number

func (*Float) Sub

func (f *Float) Sub(a, b *Float) *Float

Sub subtracts two imaginary numbers

func (*Float) Tan

func (f *Float) Tan(x *Float) *Float

Tan computes tangent of a number https://en.wikipedia.org/wiki/Trigonometric_functions

type Matrix

type Matrix struct {
	Prec   uint
	Values [][]Rational
}

Matrix is a matrix

func NewMatrix

func NewMatrix(prec uint) Matrix

NewMatrix make a new matrix

func (*Matrix) Abs

func (m *Matrix) Abs(a *Matrix) *Matrix

Abs computes the absolute value of the entries of the matrix

func (*Matrix) Add

func (m *Matrix) Add(a, b *Matrix) *Matrix

Add adds two matricies

func (*Matrix) Arg

func (m *Matrix) Arg(a *Matrix) *Matrix

Arg computes arg(x + yi) = tan-1(y/x) https://mathworld.wolfram.com/ComplexArgument.html

func (*Matrix) Atan2

func (m *Matrix) Atan2(a *Matrix) *Matrix

Atan2 computes atan2 of x https://en.wikipedia.org/wiki/Atan2

func (*Matrix) Conj

func (m *Matrix) Conj(a *Matrix) *Matrix

Conj computes the complex conjugate of a

func (*Matrix) Cos

func (m *Matrix) Cos(a *Matrix) *Matrix

Cos computes cosine of a number https://www.wolframalpha.com/input/?i=cos%28x+%2B+yi%29

func (*Matrix) Div

func (m *Matrix) Div(a, b *Matrix) *Matrix

Div divides two matricies

func (*Matrix) Exp

func (m *Matrix) Exp(a *Matrix) *Matrix

Exp computes e^x for a complex number https://www.wolframalpha.com/input/?i=e%5E%28x+%2B+yi%29

func (*Matrix) Log

func (m *Matrix) Log(a *Matrix) *Matrix

Log computes the natural log of x https://en.wikipedia.org/wiki/Complex_logarithm

func (*Matrix) Mul

func (m *Matrix) Mul(a, b *Matrix) *Matrix

Mul multiplies two matricies

func (*Matrix) Neg

func (m *Matrix) Neg(a *Matrix) *Matrix

Neg negates the rational

func (*Matrix) Pow

func (m *Matrix) Pow(x *Matrix, y *Rational) *Matrix

Pow computes x**y https://mathworld.wolfram.com/ComplexExponentiation.html

func (*Matrix) Sin

func (m *Matrix) Sin(a *Matrix) *Matrix

Sin computes sine of a number https://www.wolframalpha.com/input/?i=sin%28x+%2B+yi%29

func (*Matrix) Sqrt

func (m *Matrix) Sqrt(a *Matrix) *Matrix

Sqrt computes the square root of the matrix

func (*Matrix) String

func (m *Matrix) String() string

func (*Matrix) Sub

func (m *Matrix) Sub(a, b *Matrix) *Matrix

Sub subtracts two matricies

func (*Matrix) Tan

func (m *Matrix) Tan(a *Matrix) *Matrix

Tan computes tangent of a number https://en.wikipedia.org/wiki/Trigonometric_functions

type Rational

type Rational struct {
	A, B *big.Rat
}

Rational is an imaginary number

func NewRational

func NewRational(a, b *big.Rat) *Rational

NewRational creates a new imaginary number

func (*Rational) Add

func (r *Rational) Add(a, b *Rational) *Rational

Add add two imaginary numbers

func (*Rational) Conj

func (r *Rational) Conj(a *Rational) *Rational

Conj computes the complex conjugate of a

func (*Rational) Div

func (r *Rational) Div(a, b *Rational) *Rational

Div divides two imaginary numbers

func (*Rational) Mul

func (r *Rational) Mul(a, b *Rational) *Rational

Mul multiples two imaginary numbers

func (*Rational) Neg

func (r *Rational) Neg(a *Rational) *Rational

Neg negates the rational

func (*Rational) String

func (r *Rational) String() string

String returns a string of the imaginary number

func (*Rational) Sub

func (r *Rational) Sub(a, b *Rational) *Rational

Sub subtracts two imaginary numbers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址