/** * Returns the Euclidean distance between the given point and the nearest point inside the * bounds of the given rectangle. If the supplied point is inside the rectangle, the distance * will be zero. */ public static float pointRectDistance (IRectangle r, IPoint p) { return FloatMath.sqrt(pointRectDistanceSq(r, p)); } }
/** * Returns the Euclidean distance between the specified two points. */ public static float distance (float x1, float y1, float x2, float y2) { return FloatMath.sqrt(distanceSq(x1, y1, x2, y2)); }
@Override // from IQuaternion public Quaternion normalize (Quaternion result) { float rlen = 1f / FloatMath.sqrt(x*x + y*y + z*z + w*w); return result.set(x*rlen, y*rlen, z*rlen, w*rlen); }
/** * Returns the distance between the specified point and the specified line segment. */ public static float pointSegDist (float px, float py, float x1, float y1, float x2, float y2) { return FloatMath.sqrt(pointSegDistSq(px, py, x1, y1, x2, y2)); }
/** * Returns the distance from the specified point to the specified line. */ public static float pointLineDist (float px, float py, float x1, float y1, float x2, float y2) { return FloatMath.sqrt(pointLineDistSq(px, py, x1, y1, x2, y2)); }
/** * Returns the Euclidean distance between the given point and the nearest point inside the * bounds of the given rectangle. If the supplied point is inside the rectangle, the distance * will be zero. */ public static float pointRectDistance (IRectangle r, IPoint p) { return FloatMath.sqrt(pointRectDistanceSq(r, p)); } }
/** * Returns the Euclidean distance between the specified two points. */ public static float distance (float x1, float y1, float x2, float y2) { return FloatMath.sqrt(distanceSq(x1, y1, x2, y2)); }
/** * Returns the distance from the specified point to the specified line. */ public static float pointLineDist (float px, float py, float x1, float y1, float x2, float y2) { return FloatMath.sqrt(pointLineDistSq(px, py, x1, y1, x2, y2)); }
/** * Returns the magnitude of the specified vector. */ public static float length (float x, float y) { return FloatMath.sqrt(lengthSq(x, y)); }
@Override // from IQuaternion public Quaternion normalize (Quaternion result) { float rlen = 1f / FloatMath.sqrt(x*x + y*y + z*z + w*w); return result.set(x*rlen, y*rlen, z*rlen, w*rlen); }
/** * Returns the magnitude of the specified vector. */ public static float length (float x, float y) { return FloatMath.sqrt(lengthSq(x, y)); }