From 1f1deea662da4328bf588c0642c8a90c7b1f2144 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 24 Sep 2013 21:06:41 -0400 Subject: Rough draft of manual. --- doc/math/vector2.texi | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 doc/math/vector2.texi (limited to 'doc/math/vector2.texi') diff --git a/doc/math/vector2.texi b/doc/math/vector2.texi new file mode 100644 index 0000000..13c2f80 --- /dev/null +++ b/doc/math/vector2.texi @@ -0,0 +1,76 @@ +@node Vectors +@section Vectors + +2D vector math operations. Vector objects are of type vector2 to avoid +confusion with regular Scheme vectors. + +@anchor{2d vector2 vector2}@defspec vector2 +@end defspec + +@anchor{2d vector2 vector2?}@defspec vector2? +@end defspec + +@anchor{2d vector2 vx}@defspec vx +@end defspec + +@anchor{2d vector2 vy}@defspec vy +@end defspec + +@anchor{2d vector2 null-vector2}@defvar null-vector2 +@end defvar + +@anchor{2d vector2 identity-vector2}@defvar identity-vector2 +@end defvar + +@anchor{2d vector2 vector2-polar}@defun vector2-polar r theta +Convert the polar coordinates (R, THETA) into a cartesian vector. + +@end defun + +@anchor{2d vector2 v+}@defun v+ . vectors +Return the sum of all VECTORS. + +@end defun + +@anchor{2d vector2 v*}@defun v* . vectors +Return the product of all VECTORS. + +@end defun + +@anchor{2d vector2 vscale}@defun vscale v scalar +Multiply the vector V by a scalar value. + +@end defun + +@anchor{2d vector2 vmag}@defun vmag v +Return the magnitude of the vector V. + +@end defun + +@anchor{2d vector2 vnorm}@defun vnorm v +Normalize the vector V. + +@end defun + +@anchor{2d vector2 vdot}@defun vdot v1 v2 +Return the dot product of the vectors V1 and V2. + +@end defun + +@anchor{2d vector2 vcross}@defun vcross v1 v2 +Return the cross product of the vectors V1 and V2. Technically, the +cross product of a 2D vector is not defined. This function instead +returns the Z coordinate of the cross product as if the vectors were in +3D space. + +@end defun + +@anchor{2d vector2 vector2-translate}@defun vector2-translate v +Perform an OpenGL translate operation with the vector V. + +@end defun + +@anchor{2d vector2 vector2-scale}@defun vector2-scale v +Perform an OpenGL scale operation with the vector V. + +@end defun -- cgit v1.2.3