package
Version:
v0.0.0-...-4d4b827
Opens a new window with list of versions in this module.
Published: Jun 20, 2021
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Mag returns the magnitude of v.
Mag2 returns the magnitude squared of v.
type Ray struct {
Origin, Direction Vec
}
type Vec struct {
X, Y, Z float64
}
Vec is a 3D vector.
At returns the linear interpolation of r at t.
NewVec returns a new Vec with the given coordinates.
Scale returns v scaled by f.
Unit returns the unit vector in the direction of v.
It panics if v is the zero vector.
Color returns the color corresponding to v.
[0, 1] for XYZ is mapped to [0, 255] for RGB.
The alpha channel is always 255.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.