|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthealpix.essentials.Vec3
public class Vec3
Cartesian 3-vector. Instead of using the javax.vecmath.Vector3d class, this separate class was implemented for two reasons: first, to avoid the external dependency from vecmath.jar, and also because the function Vector3d.angle(Vector3d v1) is too inaccurate for usage in Healpix for very small angles.
Field Summary | |
---|---|
double |
x
|
double |
y
|
double |
z
|
Constructor Summary | |
---|---|
Vec3()
Default constructor. |
|
Vec3(double[] arr)
|
|
Vec3(double x1,
double y1,
double z1)
Creation from individual components |
|
Vec3(Pointing ptg)
Conversion from Pointing |
|
Vec3(Vec3 v)
|
|
Vec3(Zphi zphi)
Conversion from Zphi |
Method Summary | |
---|---|
Vec3 |
add(Vec3 v)
Vector addition |
double |
angle(Vec3 v1)
Angle between two vectors. |
Vec3 |
cross(Vec3 v)
Vector cross product. |
double |
dot(Vec3 v1)
Computes the dot product of the this vector and v1 . |
boolean |
equals(Object o)
|
void |
flip()
Invert the signs of all components |
int |
hashCode()
|
double |
length()
Vector length |
double |
lengthSquared()
Squared vector length |
Vec3 |
mul(double n)
Vector scaling. |
void |
normalize()
Normalize the vector |
void |
scale(double n)
Scale the vector by a given factor |
Vec3 |
sub(Vec3 v)
Vector subtraction |
double[] |
toArray()
|
void |
toArray(double[] arr)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double x
public double y
public double z
Constructor Detail |
---|
public Vec3()
public Vec3(Vec3 v)
public Vec3(double x1, double y1, double z1)
public Vec3(Pointing ptg)
Pointing
public Vec3(Zphi zphi)
Zphi
public Vec3(double[] arr)
Method Detail |
---|
public final double length()
public final double lengthSquared()
public void normalize()
public final double angle(Vec3 v1)
v1
- another vector
v1
;
constrained to the range [0,PI].public Vec3 cross(Vec3 v)
v
- another vector
v
public Vec3 mul(double n)
n
- the scale number to be multiply to the coordinates x,y,z
n
public void flip()
public void scale(double n)
n
- the scale factorpublic final double dot(Vec3 v1)
v1
.
v1
- another vector
public Vec3 add(Vec3 v)
v
- the vector to be added
public Vec3 sub(Vec3 v)
v
- the vector to be subtracted
public String toString()
toString
in class Object
public double[] toArray()
public void toArray(double[] arr)
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
"Built from revision exported" | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |