Documentation ¶
Index ¶
- func Dot(v1 Vec3, v2 Vec3) float64
- type Point3
- type Ray
- type Vec3
- func (v Vec3) Add(v2 Vec3) Vec3
- func (v Vec3) Length() float64
- func (v Vec3) LengthSq() float64
- func (v Vec3) Mult(v2 Vec3) Vec3
- func (v Vec3) NearZero() bool
- func (v Vec3) Negate() Vec3
- func (v Vec3) Reflect(n Vec3) Vec3
- func (v Vec3) Refract(n Vec3, niOverNt float64) (bool, *Vec3)
- func (v Vec3) Scale(t float64) Vec3
- func (v Vec3) Sub(v2 Vec3) Vec3
- func (v Vec3) Unit() Vec3
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Point3 ¶
type Point3 struct {
X, Y, Z float64
}
Point3 defines a point in 3D space
type Vec3 ¶
type Vec3 struct {
X, Y, Z float64
}
Vec3 defines a vector in 3D space
func RandomInUnitDisk ¶
func RandomInUnitSphere ¶
func RandomUnitSphere ¶
func (Vec3) Refract ¶
Refract returns a refracted vector (or not if there is no refraction possible)
Click to show internal directories.
Click to hide internal directories.