forked from srinathr91/TestJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
23 lines (17 loc) · 391 Bytes
/
Test.java
File metadata and controls
23 lines (17 loc) · 391 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.awt.Graphics2D;
public class Test {
public static void main(String[] args){
//declaring coordinates
int x1 = 50;
int y1 = 100;
int x2 = 250;
int y2 = 150;
//drawing line
Graphics2D.lineStyle(3);
Graphics2D.moveTo(x1, y1);
graphics.lineTo(x2, y2)
//forming line vectors
line = new Vector2D(x2 - x1, y2 - y1);
leftNormal = line.rotate(Math.PI * -0.5);
}
}