Package lejos.geom

Examples of lejos.geom.Point


  /**
   * allocate a new Pose at the origin, heading  = 0:the direction  the positive X axis
   */
public Pose()
{
  _location = new Point(0,0);
  _heading = 0;
}
View Full Code Here


* @param y the Y coordinate
* @param heading the heading
*/
public Pose(float x, float y, float heading)
{
  _location = new Point(x,y);
  _heading = heading;
}
View Full Code Here

* @param destination
* @return angle in degrees
*/
public float angleTo(Point destination)
{
  Point d = delta(destination);
  return (float)Math.toDegrees(Math.atan2(d.getY(),d.getX()));
}
View Full Code Here

* @param destination
* @return  the distance
*/
public float distanceTo(Point destination)
{
   Point d = delta(destination);
  return (float) Math.sqrt( d.getX()*d.getX() + d.getY()*d.getY());
}
 
View Full Code Here

   Point d = delta(destination);
  return (float) Math.sqrt( d.getX()*d.getX() + d.getY()*d.getY());
}
private Point delta(Point d)
{
  return new Point((float)(d.getX() - _location.getX()),
          (float) (d.getY() - _location.getY()));
}
View Full Code Here

  /**
   * allocate a new Pose at the origin, heading  = 0:the direction  the positive X axis
   */
public Pose()
{
  _location = new Point(0,0);
  _heading = 0;
}
View Full Code Here

* @param y the Y coordinate
* @param heading the heading
*/
public Pose(float x, float y, float heading)
{
  _location = new Point(x,y);
  _heading = heading;
}
View Full Code Here

* @param destination
* @return angle in degrees
*/
public float angleTo(Point destination)
{
  Point d = delta(destination);
  return (float)Math.toDegrees(Math.atan2(d.getY(),d.getX()));
}
View Full Code Here

* @param destination
* @return  the distance
*/
public float distanceTo(Point destination)
{
   Point d = delta(destination);
  return (float) Math.sqrt( d.getX()*d.getX() + d.getY()*d.getY());
}
 
View Full Code Here

   Point d = delta(destination);
  return (float) Math.sqrt( d.getX()*d.getX() + d.getY()*d.getY());
}
private Point delta(Point d)
{
  return new Point((float)(d.getX() - _location.getX()),
          (float) (d.getY() - _location.getY()));
}
View Full Code Here

TOP

Related Classes of lejos.geom.Point

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.