From 279f17ac0e1b3d019c2b294098e834d249376686 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 4 Jun 2019 20:49:16 -0400 Subject: Update chickadee manual. --- manuals/chickadee/Vectors.html | 90 ++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 38 deletions(-) (limited to 'manuals/chickadee/Vectors.html') diff --git a/manuals/chickadee/Vectors.html b/manuals/chickadee/Vectors.html index 4857f0a..20632cd 100644 --- a/manuals/chickadee/Vectors.html +++ b/manuals/chickadee/Vectors.html @@ -1,6 +1,6 @@ - @@ -133,99 +135,105 @@ functions, they do not compose well and create more verbose code.

2.2.2.2 2D Vectors

-
Procedure: vec2 x y
+
Procedure: vec2 x y

Return a new 2D vector with coordinates (x, y).

-
Procedure: vec2/polar r theta
+
Procedure: vec2/polar r theta

Return a new 2D vector containing the Cartesian representation of the polar coordinate (r, theta). The angle theta is measured in radians.

-
Procedure: vec2? obj
+
Procedure: vec2? obj

Return #t if obj is a 2D vector.

-
Procedure: vec2-x v
+
Procedure: vec2-x v

Return the X coordinate of the 2D vector v.

-
Procedure: vec2-y v
+
Procedure: vec2-y v

Return the Y coordinate of the 2D vector v.

-
Procedure: vec2-copy v
+
Procedure: vec2-copy v

Return a fresh copy of the 2D vector v.

-
Procedure: vec2-magnitude v
+
Procedure: vec2-magnitude v

Return the magnitude of the 2D vector v.

-
Procedure: vec2-dot-product v1 v2
+
Procedure: vec2-dot-product v1 v2

Return the dot product of the 2D vectors v1 and v2.

-
Procedure: vec2-normalize v
+
Procedure: vec2-normalize v

Return the normalized form of the 2D vector v.

-
Procedure: vec2+ v x
+
Procedure: vec2+ v x

Add x, either a 2D vector or a scalar (i.e. a real number), to the 2D vector v and return a new vector containing the sum.

-
Procedure: vec2- v x
+
Procedure: vec2- v x

Subtract x, either a 2D vector or a scalar, from the 2D vector v and return a new vector containing the difference.

-
Procedure: vec2* v x
+
Procedure: vec2* v x

Multiply the 2D vector v by x, a 2D vector or a scalar, and return a new vector containing the product.

-
Procedure: set-vec2-x! v x
+
Procedure: set-vec2-x! v x

Set the X coordinate of the 2D vector v to x.

-
Procedure: set-vec2-y! v y
+
Procedure: set-vec2-y! v y

Set the Y coordinate of the 2D vector v to y.

-
Procedure: vec2-copy! source target
+
Procedure: set-vec2! v x y
+

Set the X and Y coordinates of the 2D vector v to x and +y, respectively. +

+ +
+
Procedure: vec2-copy! source target

Copy the 2D vector source into the 2D vector target.

-
Procedure: vec2-add! v x
+
Procedure: vec2-add! v x

Perform an in-place modification of the 2D vector v by adding x, a 2D vector or a scalar.

-
Procedure: vec2-sub! v x
+
Procedure: vec2-sub! v x

Perform an in-place modification of the 2D vector v by subtracting x, a 2D vector or a scalar.

-
Procedure: vec2-mult! v x
+
Procedure: vec2-mult! v x

Perform an in-place modification of the 2D vector v by multiplying it by x, a 2D vector or a scalar.

@@ -234,102 +242,108 @@ multiplying it by x, a 2D vector or a scalar.

2.2.2.3 3D Vectors

-
Procedure: vec3 x y
+
Procedure: vec3 x y

Return a new 2D vector with coordinates (x, y).

-
Procedure: vec3? obj
+
Procedure: vec3? obj

Return #t if obj is a 3D vector.

-
Procedure: vec3-x v
+
Procedure: vec3-x v

Return the X coordinate of the 3D vector v.

-
Procedure: vec3-y v
+
Procedure: vec3-y v

Return the Y coordinate of the 3D vector v.

-
Procedure: vec3-z v
+
Procedure: vec3-z v

Return the Z coordinate of the 3D vector v.

-
Procedure: vec3-copy v
+
Procedure: vec3-copy v

Return a fresh copy of the 3D vector v.

-
Procedure: vec3-magnitude v
+
Procedure: vec3-magnitude v

Return the magnitude of the 3D vector v.

-
Procedure: vec3-dot-product v1 v2
+
Procedure: vec3-dot-product v1 v2

Return the dot product of the 3D vectors v1 and v2.

-
Procedure: vec3-normalize v
+
Procedure: vec3-normalize v

Return the normalized form of the 3D vector v.

-
Procedure: vec3+ v x
+
Procedure: vec3+ v x

Add x, either a 3D vector or a scalar (i.e. a real number), to the 3D vector v and return a new vector containing the sum.

-
Procedure: vec3- v x
+
Procedure: vec3- v x

Subtract x, either a 3D vector or a scalar, from the 3D vector v and return a new vector containing the difference.

-
Procedure: vec3* v x
+
Procedure: vec3* v x

Multiply the 3D vector v by x, a 3D vector or a scalar, and return a new vector containing the product.

-
Procedure: set-vec3-x! v x
+
Procedure: set-vec3-x! v x

Set the X coordinate of the 3D vector v to x.

-
Procedure: set-vec3-y! v y
+
Procedure: set-vec3-y! v y

Set the Y coordinate of the 3D vector v to y.

-
Procedure: set-vec3-z! v z
+
Procedure: set-vec3-z! v z

Set the Z coordinate of the 3D vector v to z.

-
Procedure: vec3-copy! source target
+
Procedure: set-vec3! v x y z
+

Set the X, Y, and Z coordinates of the 3D vector v to x, +y, and z, respectively. +

+ +
+
Procedure: vec3-copy! source target

Copy the 3D vector source into the 3D vector target.

-
Procedure: vec3-add! v x
+
Procedure: vec3-add! v x

Perform an in-place modification of the 3D vector v by adding x, a 3D vector or a scalar.

-
Procedure: vec3-sub! v x
+
Procedure: vec3-sub! v x

Perform an in-place modification of the 3D vector v by subtracting x, a 3D vector or a scalar.

-
Procedure: vec3-mult! v x
+
Procedure: vec3-mult! v x

Perform an in-place modification of the 3D vector v by multiplying it by x, a 3D vector or a scalar.

-- cgit v1.2.3