public class Vector2 extends Real2
C_AMP, C_APOS, C_ATSIGN, C_BACKSLASH, C_BACKSPACE, C_CARET, C_COLON, C_COMMA, C_DEL, C_DOLLAR, C_EQUALS, C_FORMFEED, C_HASH, C_LANGLE, C_LBRAK, C_LCURLY, C_LSQUARE, C_MINUS, C_NBSP, C_NEWLINE, C_NL, C_PERCENT, C_PERIOD, C_PIPE, C_PLUS, C_POUND, C_QUERY, C_QUOT, C_RANGLE, C_RBRAK, C_RCURLY, C_RETURN, C_RSQUARE, C_SEMICOLON, C_SHRIEK, C_SLASH, C_SPACE, C_STAR, C_TAB, C_TILDE, C_UNDER, EPS, F_S, NONWHITEPUNC, NONWHITEPUNC0, NONWHITEPUNC0REGEX, ONE_THIRD, PUNC, S_AMP, S_APOS, S_ATSIGN, S_BACKSLASH, S_CARET, S_COLON, S_COMMA, S_DOLLAR, S_EMPTY, S_EQUALS, S_FORMFEED, S_HASH, S_LANGLE, S_LBRAK, S_LCURLY, S_LSQUARE, S_MINUS, S_NEWLINE, S_NL, S_PERCENT, S_PERIOD, S_PIPE, S_PLUS, S_POUND, S_QUERY, S_QUOT, S_RANGLE, S_RBRAK, S_RCURLY, S_RETURN, S_RSQUARE, S_SEMICOLON, S_SHRIEK, S_SLASH, S_SPACE, S_STAR, S_TAB, S_TILDE, S_UNDER, S_WHITEREGEX, TWO_THIRDS, U_S, WHITESPACE| Constructor and Description |
|---|
Vector2(double x,
double y)
constructor.
|
Vector2(Real2 r)
constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Angle |
getAngleMadeWith(Vector2 v)
I *think* I have written this so that the angle is positive as this
rotates anticlockwise to vector.
|
double |
getPerpProduct(Vector2 v)
perp product (Hill).
|
boolean |
isAntiParallelTo(Vector2 v,
double eps)
is vector antiparallel to another
calculates angle between vectors
|
boolean |
isParallelTo(Vector2 v,
double eps)
is vector parallel to another
calculates angle between vectors
|
Vector2 |
projectOnto(Vector2 v2)
projection of this onto vector.
|
addPolygonOnLine, clear, createFromString, dotProduct, elementAt, format, getAngle, getAngle, getCentroid, getDistance, getDistanceMatrix, getLength, getMidPoint, getSerialOfNearestPoint, getSquaredDistance, getTransformed, getUnitVector, getX, getXY, getY, isEqualTo, isEqualTo, isOrigin, isOrigin, makePoint, multiplyBy, multiplyEquals, negative, plus, plusEquals, setX, setY, sortAscending, sortDescending, subtract, swap, toString, transformBypublic Vector2(Real2 r)
r - coordinatespublic Vector2(double x,
double y)
x - y - public Angle getAngleMadeWith(Vector2 v)
v - public boolean isParallelTo(Vector2 v, double eps)
v - eps - tolerance in radians (should be non-negative)public boolean isAntiParallelTo(Vector2 v, double eps)
v - eps - tolerance in radians (should be non-negative)public double getPerpProduct(Vector2 v)
v - Copyright © 1994–2024 Peter Murray-Rust. All rights reserved.