public class Vector3D
extends java.lang.Object
Constructor | Description |
---|---|
Vector3D(double x,
double y,
double z) |
|
Vector3D(Coordinate v) |
|
Vector3D(Coordinate from,
Coordinate to) |
Modifier and Type | Method | Description |
---|---|---|
static Vector3D |
create(double x,
double y,
double z) |
Creates a new vector with given X and Y components.
|
static Vector3D |
create(Coordinate coord) |
Creates a vector from a
Coordinate . |
static double |
dot(Coordinate v1,
Coordinate v2) |
Computes the 3D dot-product of two
Coordinate s. |
static double |
dot(Coordinate A,
Coordinate B,
Coordinate C,
Coordinate D) |
Computes the dot product of the 3D vectors AB and CD.
|
double |
dot(Vector3D v) |
Computes the dot-product of two vectors
|
double |
getX() |
|
double |
getY() |
|
double |
getZ() |
|
double |
length() |
|
static double |
length(Coordinate v) |
|
Vector3D |
normalize() |
|
static Coordinate |
normalize(Coordinate v) |
|
java.lang.String |
toString() |
Gets a string representation of this vector
|
public Vector3D(Coordinate v)
public Vector3D(Coordinate from, Coordinate to)
public Vector3D(double x, double y, double z)
public static double dot(Coordinate A, Coordinate B, Coordinate C, Coordinate D)
A
- B
- C
- D
- public static Vector3D create(double x, double y, double z)
x
- the x componenty
- the y componentz
- the z componentpublic static Vector3D create(Coordinate coord)
Coordinate
.coord
- the Coordinate to copypublic static double dot(Coordinate v1, Coordinate v2)
Coordinate
s.v1
- the first vectorv2
- the second vectorpublic double getX()
public double getY()
public double getZ()
public double dot(Vector3D v)
v
- a vectorpublic double length()
public static double length(Coordinate v)
public Vector3D normalize()
public static Coordinate normalize(Coordinate v)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018. All rights reserved.