forked from mushfiq/rssi-system
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoint.java
More file actions
75 lines (67 loc) · 1.46 KB
/
Point.java
File metadata and controls
75 lines (67 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package dataobjects;
/**
* This class represent a simple 2D point with decimal x and y coordinate
* @author Silvio
*
*/
public class Point
{
private float x; //The x coordinate of this point
private float y; //The y coordinate of this point
/**
* The default constructor for a point which gives as the Point (0/0)
* @author Silvio
*/
public Point()
{
x = 0.0f;
y = 0.0f;
}
/**
* A special constructor for a point objects which sets the coordinate to the given x and y value
* @author Silvio
* @param x The x coordinate of the point
* @param y The y coordinate of the point
*/
public Point(float x, float y)
{
this.x = x;
this.y = y;
}
/**
* Getter for the x coordinate
* @return The x coordinate of this point
*/
public float getX()
{
return x;
}
/**
* Getter for the y coordinate
* @return The y coordinate of this point
*/
public float getY()
{
return y;
}
/**
* This method scaling this point in the x and y-direction for the define scalingX and scalingY
* @param scalingX The scaling value for the x-direction
* @param scalingY The scaling value for the y-direction
*/
public void scale(float scalingX, float scalingY)
{
x = x * scalingX;
y = y * scalingY;
}
@Override
/**
* The toString method which returns a string representation of this object
* @author Silvio
* @return The string that represent this object
*/
public String toString()
{
return "(" + x + " / " + y +")";
}
}