Vector2
final class Vector2
Package: dev.joid.tool.msdf.geometry · Module: tool-msdf · Source: Vector2.java
An immutable 2D vector of the MSDF generator.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
Vector2 | of(double x, double y) factory | Returns the vector of those coordinates. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
Vector2 | add(Vector2 other) | Returns the sum of both vectors. |
Vector2 | subtract(Vector2 other) | Returns the difference of both vectors. |
Vector2 | scale(double factor) | Returns the vector multiplied by the factor. |
Vector2 | normalize() | Returns the vector of length 1 in the same direction. |
double | dot(Vector2 other) | Returns the dot product. |
double | cross(Vector2 other) | Returns the cross product, the signed area of both vectors. |
double | length() | Returns the length. |
double | getX() | Returns the abscissa. |
double | getY() | Returns the ordinate. |
Creation details
Section titled “Creation details”Vector2 of(double x, double y) factory
Returns the vector of those coordinates.
Method details
Section titled “Method details”Vector2 add(Vector2 other)
Returns the sum of both vectors.
subtract
Section titled “subtract”Vector2 subtract(Vector2 other)
Returns the difference of both vectors.
Vector2 scale(double factor)
Returns the vector multiplied by the factor.
normalize
Section titled “normalize”Vector2 normalize()
Returns the vector of length 1 in the same direction.
double dot(Vector2 other)
Returns the dot product.
double cross(Vector2 other)
Returns the cross product, the signed area of both vectors.
length
Section titled “length”double length()
Returns the length.
double getX()
Returns the abscissa.
double getY()
Returns the ordinate.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
