OHOS::Vector2< T >

Overview

Related Modules:

Graphic

Description:

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

Since:

1.0

Version:

1.0

Summary

Public Member Functions

Public Member Function Name

Description

Vector2 ()

 

A constructor used to create a Vector2 instance.

Vector2 (T x, T y)

 

A constructor used to create a Vector2 instance based on the X and Y coordinates.

~Vector2 ()

 

A destructor used to delete the Vector2 instance.

Dot (const Vector2< T > &other) const

Calculates the scalar product of the two-dimensional vector and another two-dimensional vector.

Cross (const Vector2< T > &other) const

Calculates the cross product of the two-dimensional vector and another two-dimensional vector.

operator new (size_t size)

void  

Overrides the new function.

operator delete (void p)

void 

Overrides the delete function.