Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: 3D Graphics Programming With QuickDraw 3D /
Chapter 4 - Geometric Objects / Geometric Objects Reference
Data Structures


Vectors

QuickDraw 3D defines two- and three-dimensional vectors in the usual way, as pairs and triples of floating-point numbers. Vectors are defined by data types distinct from those that define points primarily for conceptual clarity and for enforcing the correct usage of vectors in mathematical routines. Vectors are defined by the TQ3Vector2D and TQ3Vector3D data types.

typedef struct TQ3Vector2D {
   float       x;
   float       y;
} TQ3Vector2D;
typedef struct TQ3Vector3D {
   float       x;
   float       y;
   float       z;
} TQ3Vector3D;
Field Description
x
The x scalar component of a vector.
y
The y scalar component of a vector.
z
The z scalar component of a vector.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help