Numbers and arithmetic

Graphics use IEEE double precision (64-bit) floating point arithmetic for both 2D and 3D graphics so that you can integrate 2D and 3D graphics within the same program and make calculations with very high precision in both 2D and 3D. The following data types define the variables used in 2D and 3D calculations.

GCoordinate

    typedef double GCoordinate;
GCoordinate expresses values
defined or measured in 2D or 3D worldcoordinate units such as positions or lengths. Variables of type GCoordinate are used in all of the geometry classes to allow for smooth curves. GCoordinate provides sufficient range and precision for large documents, complex curves, and matrix operations.

GDegrees

    typedef double GDegrees;
GDegrees measures angles in degrees and is used when an angle needs to be specified or returned. Angles start with 0 degrees at the +x-axis, and they increase from 0 degrees to 360 degrees going clockwise in 2D (the +y-axis points down) and counterclockwise in 3D (the +Y-axis points up). Angles greater than 360 degrees are interpreted as modulo 360 degrees.

GParametric

    typedef double GParametric;
GParametric represents the parameter of a parametric curve, loop, or surface. The parametric curve or loop is represented by the function P(u) that returns point P on the curve for a particular value of the parameter u. P(0) returns the point at the start of the curve, and p(1) returns the point at the end of the curve.

GIntensity

    typedef float GIntensity;
GIntensity is a 32-bit data type that represents a range between 0 and 1.0 that is used in most device color spaces to represent color intensity. This data type is found in some of the Color framework color classes. Color as it pertains to graphics is described in Chapter 7.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker