# graphic\_math.h ## **Overview** **Related Modules:** [Graphic](Graphic.md) **Description:** Defines mathematical operation functions and types, including trigonometric functions, two-dimensional vectors, three-dimensional vectors, and matrices. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Data Structures

Data Structure Name

Description

OHOS::Vector2< T >

Defines the two-dimensional vector, and provides basic mathematical operations such as vector assignment, scalar product, cross product, addition, and subtraction.

OHOS::Vector3< T >

Defines the 3-dimensional vector, and provides basic operators such as [] and ==.

OHOS::Matrix3< T >

Defines a 3 x 3 matrix.

## Macros

Macro Name and Value

Description

MATH_MAX(a, b)   ((a) > (b) ? (a) : (b))

Larger of a and b.

MATH_MIN(a, b)   ((a) < (b) ? (a) : (b))

Smaller of a and b.

MATH_ABS(x)   ((x) > 0 ? (x) : (-(x)))

Absolute value of x.

MATH_MINUS(a, b)   ((a) < (b) ? ((b) - (a)) : ((a) - (b)))

Difference between a and b.