/** * @return The geometric length of this vector. */ public final double length() { return Math.sqrt( lengthSquared() ); }
public DVector6(double d0, double d1, double d2, double d3, double d4, double d5) { this(); set(d0, d1, d2, d3, d4, d5); }
/** * Do not use. This can be slow, use isEq() instead. */ @Override @Deprecated public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof DVector6)) return false; return isEq((DVector6)obj); }
/** * this may be called for vectors `a' with extremely small magnitude, for * example the result of a cross product on two nearly perpendicular vectors. * we must be robust to these small vectors. to prevent numerical error, * first find the component a[i] with the largest magnitude and then scale * all the components by 1/a[i]. then we can compute the length of `a' and * scale the components by 1/l. this has been verified to work with vectors * containing the smallest representable numbers. */ public void normalize() { if (!safeNormalize6()) throw new IllegalStateException( "Normalization failed: " + this); } }
/** * Do not use. This can be slow, use isEq() instead. */ @Override @Deprecated public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof DVector6)) return false; return isEq((DVector6)obj); }
/** * this may be called for vectors `a' with extremely small magnitude, for * example the result of a cross product on two nearly perpendicular vectors. * we must be robust to these small vectors. to prevent numerical error, * first find the component a[i] with the largest magnitude and then scale * all the components by 1/a[i]. then we can compute the length of `a' and * scale the components by 1/l. this has been verified to work with vectors * containing the smallest representable numbers. */ public void normalize() { if (!safeNormalize6()) throw new IllegalStateException( "Normalization failed: " + this); } }
public DVector6(double d0, double d1, double d2, double d3, double d4, double d5) { this(); set(d0, d1, d2, d3, d4, d5); }
/** * @return The geometric length of this vector. */ public final double length() { return Math.sqrt( lengthSquared() ); }
public DVector6(DVector6 v2) { this(); set(v2); }
public DVector6(DVector6 v2) { this(); set(v2); }
set(1.0, 0, 0, 0, 0, 0); return false;
set(1.0, 0, 0, 0, 0, 0); return false;