Skip to content

Vector2

final class Vector2
Package: dev.joid.tool.msdf.geometry · Module: tool-msdf · Source: Vector2.java

An immutable 2D vector of the MSDF generator.

ReturnsSignatureSummary
Vector2of(double x, double y) factoryReturns the vector of those coordinates.

ReturnsSignatureSummary
Vector2add(Vector2 other)Returns the sum of both vectors.
Vector2subtract(Vector2 other)Returns the difference of both vectors.
Vector2scale(double factor)Returns the vector multiplied by the factor.
Vector2normalize()Returns the vector of length 1 in the same direction.
doubledot(Vector2 other)Returns the dot product.
doublecross(Vector2 other)Returns the cross product, the signed area of both vectors.
doublelength()Returns the length.
doublegetX()Returns the abscissa.
doublegetY()Returns the ordinate.

Vector2 of(double x, double y) factory

Returns the vector of those coordinates.

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.


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

Report a problem with this page