org.jzy3d.maths
Class Vector3d
- java.lang.Object
-
- org.jzy3d.maths.Vector3d
-
public class Vector3d extends java.lang.ObjectStorage for a 3 dimensional vector defined by two points. Provide the vector function that returns the vector as a Coord3d, as well as dot product and norm.
-
-
Constructor Summary
Constructors Constructor and Description Vector3d(Coord3d p1, Coord3d p2)Create a vector, described by two coordinates.Vector3d(float x1, float y1, float z1, float x2, float y2, float z2)Create a vector, described by two points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Coord3dcross(Vector3d v)Computes the vectorial product of the current and the given vector.doubledistance(Coord3d c)Compute the distance between two coordinates.floatdot(Vector3d v)Compute the dot product between and current and given vector.Coord3dgetCenter()Return the central point of this segment.floatnorm()Compute the norm of this vector.Coord3dvector()Return the vector induced by this set of coordinates.
-
-
-
Constructor Detail
-
Vector3d
public Vector3d(float x1, float y1, float z1, float x2, float y2, float z2)Create a vector, described by two points.
-
-
Method Detail
-
vector
public Coord3d vector()
Return the vector induced by this set of coordinates.
-
dot
public float dot(Vector3d v)
Compute the dot product between and current and given vector. Reminnd that the dot product is:- 0 if vectors are perpendicular
- Parameters:
v- input vector- Returns:
- the dot product
-
cross
public Coord3d cross(Vector3d v)
Computes the vectorial product of the current and the given vector. The result is a vector defined as a Coord3d, that is perpendicular to the plan induced by current vector and vector V.
-
norm
public float norm()
Compute the norm of this vector.- Returns:
- the norm
-
distance
public double distance(Coord3d c)
Compute the distance between two coordinates.
-
getCenter
public Coord3d getCenter()
Return the central point of this segment.
-
-
DMelt 3.0 © DataMelt by jWork.ORG