|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jv.vecmath.PuVectorGeom
Static methods for vector geometry. Most methods work in euclidean vector spaces of arbitrary dimension.
| Constructor Summary | |
PuVectorGeom()
|
|
| Method Summary | |
static boolean |
circleThruPoints(PdVector center,
double radius,
PdVector p,
PdVector q,
PdVector r)
Compute circle through three given points. |
static void |
ctg(double[] ctg,
PdVector p,
PdVector q,
PdVector r)
Compute cotanges of the vertex angles at all vertices of the triangle (p, q, r). |
static double |
ctg(PdVector p,
PdVector q1,
PdVector q2)
Compute cotanges of the vertex angle at vertex p in the triangle (p, q1, q2). |
static double |
distOfLineToLine(PdVector base1,
PdVector dir1,
PdVector base2,
PdVector dir2)
Compute distance of line to line. |
static double |
distOfPointToLine(PdVector p,
PdVector base,
PdVector dir)
Compute distance of point to line. |
static double |
distOfPointToPlane(PdVector p,
PdVector base,
PdVector normal)
Compute distance of point to plane. |
static double |
distVectorOfLineToLine(PdVector lot,
PdVector base1,
PdVector dir1,
PdVector base2,
PdVector dir2)
Compute shortest distance vector of line to line. |
static void |
distVectorOfPointToLine(PdVector lot,
PdVector p,
PdVector base,
PdVector dir)
Compute shortest distance vector of point to line. |
static void |
distVectorOfPointToPlane(PdVector lot,
PdVector p,
PdVector base,
PdVector normal)
Compute shortest distance vector of point to plane. |
static boolean |
evalCircle(PdVector p,
PdVector mid,
PdVector orient,
PdVector start,
PdVector end,
double t)
Compute a point between the two end points of a circle segment. |
static boolean |
evalHelix(PdVector p,
PdVector axisBot,
PdVector axisDir,
PdVector start,
PdVector end,
double t)
Compute a point between the two end points of a segment of a helix. |
static double |
intersectionOfLineAndLine(PdVector p,
PdVector base1,
PdVector dir1,
PdVector base2,
PdVector dir2)
Check for intersection of line and line by solving equation b1+sd1 = b2+td2.
|
static double |
intersectionOfLineAndPlane(PdVector p,
PdVector base1,
PdVector dir,
PdVector base2,
PdVector normal)
Compute intersection line and plane. |
static boolean |
intersectionOfPlaneAndPlane(PdVector lineBase,
PdVector lineDir,
PdVector base1,
PdVector normal1,
PdVector base2,
PdVector normal2)
Compute intersection of plane and plane, and return the intersection line. |
static void |
projectOntoLine(PdVector v,
PdVector dir)
Project a given vector to a line through the origin. |
static void |
projectOntoLine(PdVector vProj,
PdVector v,
PdVector dir)
Project a given vector to a line through the origin. |
static void |
projectOntoPlane(PdVector v,
PdVector normal)
Project a given vector to a plane through the origin. |
static void |
projectOntoPlane(PdVector vProj,
PdVector v,
PdVector normal)
Project a given vector to a plane through the origin. |
static void |
projectPointToCircle(PdVector proj,
PdVector p,
PdVector mid,
PdVector normal,
double radius)
Project 3d-point onto circle in 3d by 1) project point onto plane of circle 2) adjust distance to mid point. |
static void |
projectPointToLine(PdVector proj,
PdVector p,
PdVector base,
PdVector dir)
Project a given point to line. |
static void |
projectPointToPlane(PdVector proj,
PdVector p,
PdVector base,
PdVector normal)
Project a given point to plane. |
static boolean |
rotatePointAroundLine(PdVector pRot,
PdVector p,
PdVector axisBase,
PdVector axisDir,
double alpha)
Rotate a point around an arbitrary axis by a given angle. |
static boolean |
rotatePointAroundVector(PdVector pRot,
PdVector p,
PdVector axisDir,
double alpha)
Rotate a point around an axis through the origin by a given angle. |
static double |
sphericalAngle(PdVector p,
PdVector q1,
PdVector q2)
Compute spherical angle at vertex p or a triangle on the unit sphere in S^n. |
static double |
sphericalArea(PdVector p,
PdVector q,
PdVector r)
Compute area of a spherical triangle on the unit sphere in S^n. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PuVectorGeom()
| Method Detail |
public static double intersectionOfLineAndLine(PdVector p,
PdVector base1,
PdVector dir1,
PdVector base2,
PdVector dir2)
b1+sd1 = b2+td2.
Multiply both sides with d1 and with d2 to obtain two scalar equations
Method works in euclidean vector spaces of arbitrary dimension.+ s = + t + s = + t => s = d2>/(1.- **2)
p - computed intersection pointbase1 - any point on the first linedir1 - unit direction of first linebase2 - any point on the second linedir2 - unit direction of second lines from base1 to intersection point,
or Double.MAX_VALUE if line and plane are parallel.
public static double intersectionOfLineAndPlane(PdVector p,
PdVector base1,
PdVector dir,
PdVector base2,
PdVector normal)
= . Use this equation to derive a
value for s by solving = leading
to s = / .
Direction of ray must be normalized, normal of plane need not be normalized.
Method works in euclidean vector spaces of arbitrary dimension.
p - computed intersection pointbase1 - any point on the linedir - unit direction of linebase2 - any point on the planenormal - normal of plane, need not be normalizeds from base1 to intersection point,
or Double.MAX_VALUE if line and plane are parallel.
public static boolean intersectionOfPlaneAndPlane(PdVector lineBase,
PdVector lineDir,
PdVector base1,
PdVector normal1,
PdVector base2,
PdVector normal2)
lineDir parallel to n1xn2 lineBase = s*n1 + t*n2.Insert in both plane equations and solve for s and t:
Method only works in euclidean 3-space.= = s + t = s + t = => s = ( - )/(1.- **2) => t = ( - )/(1.- **2)
lineBase - computed point on the intersection linelineDir - computed direction of the intersection linebase1, - base2 some points on each planenormal1, - normal2 unit normals of each planetrue if both planes intersect
public static void distVectorOfPointToLine(PdVector lot,
PdVector p,
PdVector base,
PdVector dir)
Method works in euclidean vector spaces of arbitrary dimension.
lot - resulting distance vectorp - given pointbase - some point of the linedir - unit direction of the lineprojectPointToLine(jv.vecmath.PdVector, jv.vecmath.PdVector, jv.vecmath.PdVector, jv.vecmath.PdVector)
public static void distVectorOfPointToPlane(PdVector lot,
PdVector p,
PdVector base,
PdVector normal)
Method works in euclidean vector spaces of arbitrary dimension.
lot - resulting distance vectorp - given pointbase - some point on the planenormal - unit normal of planeprojectPointToPlane(jv.vecmath.PdVector, jv.vecmath.PdVector, jv.vecmath.PdVector, jv.vecmath.PdVector)
public static double distVectorOfLineToLine(PdVector lot,
PdVector base1,
PdVector dir1,
PdVector base2,
PdVector dir2)
lot - resulting distance vectorbase1, - base2 some points on each linedir1, - dir2 direction of each linedistOfLineToLine(jv.vecmath.PdVector, jv.vecmath.PdVector, jv.vecmath.PdVector, jv.vecmath.PdVector)
public static double distOfPointToLine(PdVector p,
PdVector base,
PdVector dir)
dist = |(p-base) x dir|.
Method works in euclidean vector spaces of arbitrary dimension.
p - given pointbase - some point of the linedir - direction of the line with unit length 1.
public static double distOfPointToPlane(PdVector p,
PdVector base,
PdVector normal)
dist = .
Method works in euclidean vector spaces of arbitrary dimension.
p - given pointbase - some point of the linenormal - unit normal of plane with length 1.
public static double distOfLineToLine(PdVector base1,
PdVector dir1,
PdVector base2,
PdVector dir2)
dist = ||/|dir1xdir2| .
Special care is taken if directions are degenerate.
Currently, method works in euclidean 3-space only.
base1, - base2 some points on each linedir1, - dir2 direction of each line
public static void projectPointToLine(PdVector proj,
PdVector p,
PdVector base,
PdVector dir)
proj = base + dir .
Point and projected point may be the same vector instances.
Method works in euclidean vector spaces of arbitrary dimension.
proj - projection of p to the linep - given pointbase - some point of the linedir - unit direction of the line
public static void projectPointToPlane(PdVector proj,
PdVector p,
PdVector base,
PdVector normal)
p - normal .
Point and projected point may be the same vector instances.
Method works in euclidean vector spaces of arbitrary dimension.
proj - projection of p to the linep - given pointbase - some point of the planenormal - unit normal of plane
public static void projectPointToCircle(PdVector proj,
PdVector p,
PdVector mid,
PdVector normal,
double radius)
Method works in euclidean vector spaces of arbitrary dimension.
proj - projection of p to the linep - given pointbase - some point of the planenormal - unit normal of plane
public static void projectOntoLine(PdVector v,
PdVector dir)
v = dir/|dir|^2 .
Method works in euclidean vector spaces of arbitrary dimension.
v - given vector, also contains the resultdir - unit direction of the line
public static void projectOntoLine(PdVector vProj,
PdVector v,
PdVector dir)
vProj = dir/|dir|^2 .
Vector and projected vector may be the same vector instances.
Method works in euclidean vector spaces of arbitrary dimension.
vProj - projection of v to the line through the originv - given vectordir - unit direction of the line
public static void projectOntoPlane(PdVector v,
PdVector normal)
v = v-normal/|normal|^2 .
Method works in euclidean vector spaces of arbitrary dimension.
v - given vector, also contains the resultnormal - unit normal of the plane
public static void projectOntoPlane(PdVector vProj,
PdVector v,
PdVector normal)
vProj = v-normal/|normal|^2 .
Vector and projected vector may be the same vector instances.
Method works in euclidean vector spaces of arbitrary dimension.
vProj - projection of v to the plane through the originv - given vectornormal - unit normal of the plane
public static boolean circleThruPoints(PdVector center,
double radius,
PdVector p,
PdVector q,
PdVector r)
dist = ||/|dir1xdir2| .
Method works in euclidean vector spaces of arbitrary dimension.
center - resulting center of circleradius - resulting radius of circlep, - q, r three given pointstrue if circle could be computed.
public static boolean evalCircle(PdVector p,
PdVector mid,
PdVector orient,
PdVector start,
PdVector end,
double t)
Method only works in euclidean 3-space.
p - calculated point on circle segmentmid - center of circleorient - normal vector determines which angle to takestart - first point on circle segmentend - second point on circle segmentt - relative position in [0.,1.] between start and end on segmenttrue if circle could be evaluated.PdVector.angleWithOrientation(PdVector, PdVector, PdVector),
rotatePointAroundLine(PdVector, PdVector, PdVector, PdVector, double)
public static boolean evalHelix(PdVector p,
PdVector axisBot,
PdVector axisDir,
PdVector start,
PdVector end,
double t)
Method only works in euclidean 3-space.
p - calculated point on helix segmentaxisBot - point on axis of helixaxisDir - unit direction of axis of helixstart - first point on helixend - second point on helixt - relative position in [0.,1.] between start and end on segmenttrue if helix could be evaluated.PdVector.angleWithOrientation(PdVector, PdVector, PdVector),
rotatePointAroundLine(PdVector, PdVector, PdVector, PdVector, double)
public static boolean rotatePointAroundVector(PdVector pRot,
PdVector p,
PdVector axisDir,
double alpha)
Method only works in euclidean 3-space.
pRot - rotated pointp - point to rotateaxisDir - unit direction of rotation axis through originalpha - rotation angletrue if rotation could be performed.rotatePointAroundLine(PdVector,PdVector,PdVector,PdVector,double)
public static boolean rotatePointAroundLine(PdVector pRot,
PdVector p,
PdVector axisBase,
PdVector axisDir,
double alpha)
Method only works in euclidean 3-space.
pRot - rotated pointp - point to rotateaxisBase - some point on the rotation axisaxisDir - unit direction of rotation axisalpha - rotation angletrue if rotation could be performed.rotatePointAroundVector(PdVector,PdVector,PdVector,double)
public static double ctg(PdVector p,
PdVector q1,
PdVector q2)
Method works in euclidean vector spaces of arbitrary dimension.
p - vertex where to compute the cotangesq1, - q2 other vertices of the trianglectg(double[],PdVector,PdVector,PdVector)
public static void ctg(double[] ctg,
PdVector p,
PdVector q,
PdVector r)
Method works in euclidean vector spaces of arbitrary dimension.
ctg - cotangens of all vertex anglesp, - q, r vertices of the trianglectg(PdVector,PdVector,PdVector),
PuMath.ctg(double[],double,double,double)
public static double sphericalAngle(PdVector p,
PdVector q1,
PdVector q2)
Method works in euclidean vector spaces of arbitrary dimension.
p - vertex where to compute the angleq1, - q2 other vertices of the trianglePdVector.angle(PdVector,PdVector,PdVector)
public static double sphericalArea(PdVector p,
PdVector q,
PdVector r)
Method works in euclidean vector spaces of arbitrary dimension.
p, - q, r vertices of the trianglesphericalAngle(PdVector,PdVector,PdVector)
|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||