public class Vector3DOps extends Object
Modifier and Type | Field and Description |
---|---|
static double[] |
nxhat |
static double[] |
nyhat |
static double[] |
nzhat |
static double |
TOL |
static double[] |
xhat |
static double[] |
yhat |
static double[] |
zhat |
Constructor and Description |
---|
Vector3DOps() |
Modifier and Type | Method and Description |
---|---|
static double |
abs(double v) |
static double[] |
add(double[] a,
double[] b,
double f)
Displacing point a by the distance f along vector b.
|
static double[] |
average(double[]... v) |
static double[] |
cross(double[] a,
double[] b) |
static double[] |
difference(double[] minuend,
double[] subtrahend) |
static double |
distance(double[] a,
double[] b) |
static double |
dot(double[] a,
double[] b) |
static double[] |
getPerpendicularNormalizedVector(double[] o)
Finds the shortest component of the input vector, creates a unit vector
along that axis and then uses the cross product to get a mutually exclusive vector.
|
static double |
mag(double[] v) |
static double |
minLength(double[] l) |
static double |
normalize(double[] v)
Normalizes the vector in place and returns the original length.
|
static boolean |
proximity(double[] a,
double[] b,
double r)
Checks if a and be are within the range of r by summing the square of differences
and squaring r.
|
static double[] |
rotatePoint(double[] p,
double[] axisAngle,
double[] center) |
static double |
sqrt(double v) |
static double |
square(double a) |
static double |
toSpan(double dr,
double l)
How many dr's does it take to fill an l.
|
public static final double[] zhat
public static final double[] yhat
public static final double[] xhat
public static final double[] nzhat
public static final double[] nyhat
public static final double[] nxhat
public static final double TOL
public static double[] cross(double[] a, double[] b)
public static double dot(double[] a, double[] b)
public static double sqrt(double v)
public static double normalize(double[] v)
v
- public static double square(double a)
public static double distance(double[] a, double[] b)
public static double mag(double[] v)
public static double[] difference(double[] minuend, double[] subtrahend)
minuend
- positive valuesubtrahend
- negative valuepublic static double toSpan(double dr, double l)
dr
- chunk size.l
- length to be spanned.public static double[] add(double[] a, double[] b, double f)
a
- starting point.b
- translation vectorf
- distance translated.public static boolean proximity(double[] a, double[] b, double r)
a
- center of sphereb
- point to be checkedr
- radiuspublic static double minLength(double[] l)
public static double[] getPerpendicularNormalizedVector(double[] o)
o
- public static double abs(double v)
public static double[] average(double[]... v)
public static double[] rotatePoint(double[] p, double[] axisAngle, double[] center)
Copyright © 2013–2022 Francis Crick Institute. All rights reserved.