Documentation ¶
Index ¶
- Variables
- type Matrix
- func MakeIdentityMatrix(size uint8) Matrix
- func MakeMatrix(size uint8) Matrix
- func RotationX(rad float64) Matrix
- func RotationY(rad float64) Matrix
- func RotationZ(rad float64) Matrix
- func Scaling(x, y, z float64) Matrix
- func Shearing(xy, xz, yx, yz, zx, zy float64) Matrix
- func Translation(x, y, z float64) Matrix
- func (m Matrix) Cofactor(row, column uint8) float64
- func (m Matrix) Determinant() float64
- func (m Matrix) Equals(o Matrix) bool
- func (m Matrix) Inverse() (Matrix, error)
- func (m Matrix) Minor(row, column uint8) float64
- func (m Matrix) Multiply(o Matrix) Matrix
- func (m Matrix) Submatrix(row uint8, column uint8) Matrix
- func (m Matrix) Transpose() Matrix
- type PV
- func (p PV) Add(o PV) PV
- func (p PV) CrossProduct(o PV) PV
- func (p PV) DotProduct(o PV) float64
- func (p PV) Equals(o PV) bool
- func (p PV) Magnitude() float64
- func (p PV) Negate() PV
- func (p PV) Normalize() PV
- func (p PV) Reflect(normal PV) PV
- func (p PV) Scalar(s float64) PV
- func (p PV) Subtract(o PV) PV
- func (p PV) Transform(m Matrix) PV
- type Ray
Constants ¶
This section is empty.
Variables ¶
View Source
var EPSILON float64 = 0.00000001
EPSILON Value used for approximation
Functions ¶
This section is empty.
Types ¶
type Matrix ¶
type Matrix [][]float64
Matrix A square matrix
func MakeIdentityMatrix ¶
MakeIdentityMatrix Make an identity matrix of the given size
func MakeMatrix ¶
MakeMatrix Makes an emptry square matrix of the given size
func (Matrix) Determinant ¶
Determinant Calculates the determinant of a 2x2 matrix
type PV ¶
type PV struct{ X, Y, Z, W float64 }
PV represents 3D coordinates and a w variable for distinction between point and vector
func (PV) CrossProduct ¶
CrossProduct Returns the cross product with the PV passed in as a PV
func (PV) DotProduct ¶
DotProduct Return the dot product with the passed in PV
Click to show internal directories.
Click to hide internal directories.