BRender Technical Reference Manual:4 Data Structures (Alphabetical Reference):br_angle
Next|Prev|Up
The Integral Type
Arithmetic
Comparison
Conversion
Copy/Assign

br_angle


The Integral Type

This is BRender's own angle representation. One complete revolution corresponds to the entire range of this data type, and therefore repeated rotations will `wrap around'correctly. Use whenever an angle needs to be represented.

Also see br_scalar332 and br_euler118.

The typedef

(See angles.h for a precise declaration)

br_fixed_luf br_angle Angle type

Related Functions

Degree/Angle conversion

br_scalar BrDegreeToRadian(br_scalar s)
Converts s from angular units of degrees into radians.

br_scalar BrRadianToDegree(br_scalar s)
Converts s from angular units of radians into degrees.

Arithmetic

An angle may be negated.

Two angles may be added and subtracted.

An angle may be multiplied or divided by a standard integral type.

The following trigonometric macros may be used:

BR_SIN(a) Return Sine of br_angle102 a as a br_scalar332.

BR_COS(a) Return Cosine of br_angle102 a as a br_scalar332.

BR_ASIN(s) Return angle whose Sine is br_scalar332 s, as a br_angle102.

BR_ACOS(s) Return angle whose Cosine is br_scalar332 s, as a br_angle102.

BR_ATAN2(y,x) Return angle whose Tangent is br_scalar332 y/x, as a br_angle102.

BR_ATAN2FAST(y,x) Faster, lower precision version of BR_ATAN2(y,x).

See br_fixed_ls129 for details of fixed point functions used by these macros.

Comparison

All standard comparison operators may be applied between two angles. An angle may be compared with zero without conversion.

Conversion

From Numeric Constants

BR_ANGLE_DEG(x)
Converts x from a number of degrees to br_angle102.

BR_ANGLE_RAD(x)
Converts x from a number of radians to br_angle102.

PI
If not already defined, PI is defined as 3.14159265358979323846.

From Integral Types

To convert from integral types, use br_scalar
332 as an intermediary.

From br_scalar332

br_angle BrScalarToAngle(br_scalar s)
Converts s from a fractional revolution (0..1).

br_angle BrDegreeToAngle(br_scalar d)
Converts d from an angle in degrees.

br_angle BrRadianToAngle(br_scalar r)
Converts r from an angle in radians.

To Integral Types

To convert to integral types, use br_scalar
332 as an intermediary.

To br_scalar332

br_scalar BrAngleToScalar(br_angle a)
Converts a to a fractional revolution (0..1).

br_scalar BrAngleToDegree(br_angle a)
Converts a to an angle in degrees.

br_scalar BrAngleToRadian(br_angle a)
Converts a to an angle in radians.

Copy/Assign

Only assign zero or angles. Use conversions in all other cases.


Generated with
CERN WebMaker