Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.lang.Math;
- public class Point
- {
- //constructor
- Point (int x1, int y1)
- {
- x = x1;
- y = y1;
- }
- //Sets new point coordinates
- public void setPoint(int num1, int num2)
- {
- x = num1;
- y = num2;
- }
- //returns x-coordinate of point
- public int getX()
- {
- return x;
- }
- //returns y-coordinate of Point
- public int getY()
- {
- return y;
- }
- //returns the distance this point is from the point (0, 0)
- public double getDistanceFromOrigin()
- {
- int distance;
- distance = Math.sqrt(((x * x) + (y * y));
- }
- public static point findFarPoint(Point p1, Point p2, Point p3)
- {
- if (p1 >= p2)
- }
- private int x; //x-coordinate of point
- private int y; //y-coordinate of point
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement