@Override public boolean isOnLine (Vector2 other) { return MathUtils.isZero(x * other.y - y * other.x); }
@Override public boolean isOnLine (Vector2 other, float epsilon) { return MathUtils.isZero(x * other.y - y * other.x, epsilon); }
/** @return True if this matrix has any rotation or scaling, false otherwise */ public boolean hasRotationOrScaling () { return !(MathUtils.isEqual(val[M00], 1) && MathUtils.isEqual(val[M11], 1) && MathUtils.isEqual(val[M22], 1) && MathUtils.isZero(val[M01]) && MathUtils.isZero(val[M02]) && MathUtils.isZero(val[M10]) && MathUtils.isZero(val[M12]) && MathUtils.isZero(val[M20]) && MathUtils.isZero(val[M21])); } }
/** @return True if this matrix has any rotation or scaling, false otherwise */ public boolean hasRotationOrScaling () { return !(MathUtils.isEqual(val[M00], 1) && MathUtils.isEqual(val[M11], 1) && MathUtils.isEqual(val[M22], 1) && MathUtils.isZero(val[M01]) && MathUtils.isZero(val[M02]) && MathUtils.isZero(val[M10]) && MathUtils.isZero(val[M12]) && MathUtils.isZero(val[M20]) && MathUtils.isZero(val[M21])); } }
@Override public boolean isPerpendicular (Vector3 vector) { return MathUtils.isZero(dot(vector)); }
@Override public boolean isPerpendicular (Vector3 vector, float epsilon) { return MathUtils.isZero(dot(vector), epsilon); }
@Override public boolean isPerpendicular (Vector3 vector, float epsilon) { return MathUtils.isZero(dot(vector), epsilon); }
@Override public boolean isPerpendicular (Vector2 vector) { return MathUtils.isZero(dot(vector)); }
/** Get the angle in radians of the rotation around the specified axis. The axis must be normalized. * @param axisX the x component of the normalized axis for which to get the angle * @param axisY the y component of the normalized axis for which to get the angle * @param axisZ the z component of the normalized axis for which to get the angle * @return the angle in radians of the rotation around the specified axis */ public float getAngleAroundRad (final float axisX, final float axisY, final float axisZ) { final float d = Vector3.dot(this.x, this.y, this.z, axisX, axisY, axisZ); final float l2 = Quaternion.len2(axisX * d, axisY * d, axisZ * d, this.w); return MathUtils.isZero(l2) ? 0f : (float)(2.0 * Math.acos(MathUtils.clamp( (float)((d < 0 ? -this.w : this.w) / Math.sqrt(l2)), -1f, 1f))); }
/** Get the angle in radians of the rotation around the specified axis. The axis must be normalized. * @param axisX the x component of the normalized axis for which to get the angle * @param axisY the y component of the normalized axis for which to get the angle * @param axisZ the z component of the normalized axis for which to get the angle * @return the angle in radians of the rotation around the specified axis */ public float getAngleAroundRad (final float axisX, final float axisY, final float axisZ) { final float d = Vector3.dot(this.x, this.y, this.z, axisX, axisY, axisZ); final float l2 = Quaternion.len2(axisX * d, axisY * d, axisZ * d, this.w); return MathUtils.isZero(l2) ? 0f : (float)(2.0 * Math.acos(MathUtils.clamp( (float)((d < 0 ? -this.w : this.w) / Math.sqrt(l2)), -1f, 1f))); }