Vector2D
public final class Vector2D
Content copied to clipboard
Represents a 2-dimensional vector in plane
This class can be used to create a vector for any entity with x and y as x and y points in canvas plane. The canvas plane follows cartesian coordinate system but with origin at top left corner and positive x-axis along right direction and positive y-axis along downward direction.
For ex: Here representation of position vector in canvas plane could be given as - val position = Vector2D(25f, 25f)
Constructors
Types
Functions
Properties
Extensions
add With Scalar Multiply
Link copied to clipboard
angle Between
Link copied to clipboard
Returns angle between this vector and other vector
minus Assign
Link copied to clipboard
plus Assign
Link copied to clipboard
scalar Multiply
Link copied to clipboard
set Heading
Link copied to clipboard
Rotate the vector to a specific angle, magnitude remains the same
times Assign
Link copied to clipboard