Documentation
¶
Index ¶
- Variables
- func Dot(a, b Vector) float64
- type Axis
- type Matrix
- func DefaultIdentityMatrix() (identityMatrix Matrix)
- func DefaultIdentityMatrixInverse() (identityMatrixInverse Matrix)
- func IdentityMatrix(rows, cols int) (identityMatrix Matrix)
- func NewMatrix(rows, columns int, rowsValues ...RowValues) Matrix
- func Rotation(axis Axis, by float64) (rotation Matrix)
- func Scaling(x, y, z float64) Matrix
- func Translation(x, y, z float64) Matrix
- func ViewTransform(from, to, up Vector) (result Matrix)
- func (m Matrix) Cofactor(row, col int) float64
- func (m Matrix) Determinant() float64
- func (m Matrix) Get(row, column int) float64
- func (m Matrix) Inverse() (result Matrix, err error)
- func (m Matrix) Minor(row, col int) float64
- func (m Matrix) Multiply(by Matrix) (result Matrix)
- func (m Matrix) MultiplyByTuple(vals ...float64) (result Matrix)
- func (m Matrix) MultiplyByVector(vec Vector) (result Vector)
- func (m Matrix) Set(row, column int, val float64)
- func (m Matrix) SetRow(row int, vals ...float64)
- func (m Matrix) String() string
- func (m Matrix) SubMatrix(row, col int) (result Matrix)
- func (m Matrix) Transpose() (result Matrix)
- type Point
- type Ray
- type RowValues
- type Vector
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ZeroVector = NewVec(0, 0, 0) ZeroPoint = NewPoint(0, 0, 0) NonInvertibleErr = errors.New("non-invertible") )
Functions ¶
Types ¶
type Matrix ¶
type Matrix [][]float64
func DefaultIdentityMatrix ¶
func DefaultIdentityMatrix() (identityMatrix Matrix)
func DefaultIdentityMatrixInverse ¶
func DefaultIdentityMatrixInverse() (identityMatrixInverse Matrix)
func IdentityMatrix ¶
func Translation ¶
func ViewTransform ¶
func (Matrix) Determinant ¶
func (Matrix) MultiplyByTuple ¶
func (Matrix) MultiplyByVector ¶
type Ray ¶
type Vector ¶
type Vector interface {
GetX() float64
SetX(x float64) Vector
GetY() float64
SetY(y float64) Vector
GetZ() float64
SetZ(z float64) Vector
GetW() float64
SetW(w float64) Vector
Multiply(by float64) Vector
Multiplied(by Matrix) Vector
Add(vec Vector) Vector
Divide(by float64) Vector
Subtract(vec Vector) Vector
Magnitude() float64
Normalize() Vector
Negate() Vector
Reflect(normal Vector) Vector
Dot(n Vector) float64
}
Click to show internal directories.
Click to hide internal directories.