core
Vector3
/=
defn
(λ [a, a] Bool)
(/= a b)
=
defn
(λ [(Ref (Vector3 Double)), (Ref (Vector3 Double))] Bool)
(= a b)
add
defn
(λ [(Ref (Vector3 a)), (Ref (Vector3 a))] (Vector3 a))
(add a b)
angle-between
defn
(λ [(Ref (Vector3 Double)), (Ref (Vector3 Double))] Double)
(angle-between a b)
Get the angle between to vectors a and b.
anti-parallel?
defn
(λ [(Ref (Vector3 Double)), (Ref (Vector3 Double))] Bool)
(anti-parallel? a b)
Check whether the two vectors a and b are anti-parallel.
copy
template
(λ [(Ref (Vector3 a))] (Vector3 a))
copies the Vector3
.
cross
defn
(λ [(Ref (Vector3 a)), (Ref (Vector3 a))] (Vector3 a))
(cross a b)
Compute the cross product of the two vectors x and y.
delete
template
(λ [(Vector3 a)] ())
deletes a Vector3
. Should usually not be called manually.
div
defn
(λ [(Ref (Vector3 a)), a] (Vector3 a))
(div a n)
dot
defn
(λ [(Ref (Vector3 a)), (Ref (Vector3 a))] a)
(dot a b)
Get the dot product of the two vectors x and y.
init
template
(λ [a, a, a] (Vector3 a))
creates a Vector3
.
lerp
defn
(λ [(Ref (Vector3 a)), (Ref (Vector3 a)), a] (Vector3 a))
(lerp a b amnt)
Linearly interpolate between the two vectors a and b by amnt (between 0 and 1).
mag
defn
(λ [(Ref (Vector3 Double))] Double)
(mag o)
Get the magnitude of a vector.
mag-sq
defn
(λ [(Ref (Vector3 a))] a)
(mag-sq o)
Get the squared magnitude of a vector.
mul
defn
(λ [(Ref (Vector3 a)), a] (Vector3 a))
(mul a n)
normalize
defn
(λ [(Ref (Vector3 Double))] (Vector3 Double))
(normalize o)
Normalize a vector.
parallel?
defn
(λ [(Ref (Vector3 Double)), (Ref (Vector3 Double))] Bool)
(parallel? a b)
Check whether the two vectors a and b are parallel.
perpendicular?
defn
(λ [(Ref (Vector3 Double)), (Ref (Vector3 Double))] Bool)
(perpendicular? a b)
Check whether the two vectors a and b are perpendicular.
prn
template
(λ [(Ref (Vector3 a))] String)
converts a Vector3
to a string.
random
defn
(λ [] (Vector3 Double))
(random)
set-x
template
(λ [(Vector3 a), a] (Vector3 a))
sets the x
property of a Vector3
.
set-x!
instantiate
(λ [(Ref (Vector3 a)), a] ())
sets the x
property of a Vector3
in place.
set-y
template
(λ [(Vector3 a), a] (Vector3 a))
sets the y
property of a Vector3
.
set-y!
instantiate
(λ [(Ref (Vector3 a)), a] ())
sets the y
property of a Vector3
in place.
set-z
template
(λ [(Vector3 a), a] (Vector3 a))
sets the z
property of a Vector3
.
set-z!
instantiate
(λ [(Ref (Vector3 a)), a] ())
sets the z
property of a Vector3
in place.
str
template
(λ [(Ref (Vector3 a))] String)
converts a Vector3
to a string.
sub
defn
(λ [(Ref (Vector3 a)), (Ref (Vector3 a))] (Vector3 a))
(sub a b)
update-x
instantiate
(λ [(Vector3 a), (Ref (λ [a] a))] (Vector3 a))
updates the x
property of a Vector3
using a function f
.
update-y
instantiate
(λ [(Vector3 a), (Ref (λ [a] a))] (Vector3 a))
updates the y
property of a Vector3
using a function f
.
update-z
instantiate
(λ [(Vector3 a), (Ref (λ [a] a))] (Vector3 a))
updates the z
property of a Vector3
using a function f
.
x
instantiate
(λ [(Ref (Vector3 a))] &a)
gets the x
property of a Vector3
.
y
instantiate
(λ [(Ref (Vector3 a))] &a)
gets the y
property of a Vector3
.
z
instantiate
(λ [(Ref (Vector3 a))] &a)
gets the z
property of a Vector3
.
zero
defn
(λ [] (Vector3 Double))
(zero)