Documentation ¶
Overview ¶
Package split implements the split-complex number arithmetic.
Index ¶
- type Complex
- func (z *Complex) Add(x, y *Complex) *Complex
- func (z *Complex) Cartesian() (a, b float64)
- func (z *Complex) Conj(y *Complex) *Complex
- func (z *Complex) Copy(y *Complex) *Complex
- func (z *Complex) Curv() (r, ξ float64, sign int)
- func (z *Complex) Equals(y *Complex) bool
- func (z *Complex) Idempotent(sign int) *Complex
- func (z *Complex) Imag() float64
- func (z *Complex) Inf(a, b int) *Complex
- func (z *Complex) Inv(y *Complex) *Complex
- func (z *Complex) IsInf() bool
- func (z *Complex) IsNaN() bool
- func (z *Complex) IsZeroDiv() bool
- func (z *Complex) Mul(x, y *Complex) *Complex
- func (z *Complex) NaN() *Complex
- func (z *Complex) Neg(y *Complex) *Complex
- func (z *Complex) Quad() float64
- func (z *Complex) Quo(x, y *Complex) *Complex
- func (z *Complex) Real() float64
- func (z *Complex) Rect(r, ξ float64, sign int) *Complex
- func (z *Complex) Scal(y *Complex, a float64) *Complex
- func (z *Complex) SetImag(b float64)
- func (z *Complex) SetReal(a float64)
- func (z *Complex) String() string
- func (z *Complex) Sub(x, y *Complex) *Complex
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Complex ¶
type Complex struct {
// contains filtered or unexported fields
}
A Complex represents a split-complex number.
func New ¶
New returns a pointer to a Complex value made from two given real float64 values.
Example ¶
fmt.Println(New(1, 0)) fmt.Println(New(0, -1)) fmt.Println(New(3, -1)) fmt.Println(New(5, 7))
Output: (1+0s) (0-1s) (3-1s) (5+7s)
func (*Complex) Curv ¶
Curv returns the curvilinear coordinates of a Complex value, along with the sign of the quadrance.
func (*Complex) Idempotent ¶
Idempotent sets z equal to one of two possible idempotents (i.e. z = z*z).
func (*Complex) Inv ¶
Inv sets z equal to the inverse of y, and returns z. If y is a zero divisor, then Inv panics.
func (*Complex) IsZeroDiv ¶
IsZeroDiv returns true if z is a zero divisor (i.e. if z has vanishing quadrance).
func (*Complex) Quad ¶
Quad returns the quadrance of z, which can be either positive, negative, or zero.
func (*Complex) Quo ¶
Quo sets z equal to the quotient x/y, and returns z. If y is a zero divisor, then Quo panics.
func (*Complex) Rect ¶
Rect sets z equal to the Complex value made from given curvilinear coordinates and quadrance sign, and returns z.