@Test public void testLength() { assertEquals(2, new Vector3(2, 0, 0).getMagnitude(), 1e-9); assertEquals(2, new Vector3(0, 2, 0).getMagnitude(), 1e-9); assertEquals(2, new Vector3(0, 0, 2).getMagnitude(), 1e-9); assertEquals(Math.sqrt(3), new Vector3(1, 1, 1).getMagnitude(), 1e-9); }
public double getMagnitude() { return Math.sqrt(getMagnitudeSquared()); }
Vector3 { public double getMagnitude() { return Math.sqrt(getMagnitudeSquared()); } }
Vector3 { public double getMagnitude() { return Math.sqrt(getMagnitudeSquared()); } Vector3(double x, double y, double z); }
Vector3 { public double getMagnitude() { return Math.sqrt(getMagnitudeSquared()); } Vector3(double x, double y, double z); static Vector3 fromVector3Message(geometry_msgs.Vector3 message); static Vector3 fromPointMessage(geometry_msgs.Point message); static Vector3 zero(); static Vector3 xAxis(); static Vector3 yAxis(); static Vector3 zAxis(); Vector3 add(Vector3 other); Vector3 subtract(Vector3 other); Vector3 invert(); double dotProduct(Vector3 other); Vector3 normalize(); Vector3 scale(double factor); double getX(); double getY(); double getZ(); double getMagnitudeSquared(); double getMagnitude(); geometry_msgs.Vector3 toVector3Message(geometry_msgs.Vector3 result); geometry_msgs.Point toPointMessage(geometry_msgs.Point result); boolean almostEquals(Vector3 other, double epsilon); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
Vector3 { public double getMagnitude() { return Math.sqrt(getMagnitudeSquared()); } Vector3(double x, double y, double z); static Vector3 fromVector3Message(geometry_msgs.Vector3 message); static Vector3 fromPointMessage(geometry_msgs.Point message); static Vector3 zero(); static Vector3 xAxis(); static Vector3 yAxis(); static Vector3 zAxis(); Vector3 add(Vector3 other); Vector3 subtract(Vector3 other); Vector3 invert(); double dotProduct(Vector3 other); Vector3 normalize(); Vector3 scale(double factor); double getX(); double getY(); double getZ(); double getMagnitudeSquared(); double getMagnitude(); geometry_msgs.Vector3 toVector3Message(geometry_msgs.Vector3 result); geometry_msgs.Point toPointMessage(geometry_msgs.Point result); boolean almostEquals(Vector3 other, double epsilon); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }