ofekkfir

Magen david + getx/setx

Nov 6th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.33 KB | None | 0 0
  1.  
  2. import canvasML.*;
  3. public class line {
  4.     public static void main(String[] args) {
  5.         // TODO Auto-generated method stub
  6.        
  7.         // public Line (int xPosition, int yPosition, int xEnd, int yEnd, String color)
  8.         // valids colors are: red, yellow, blue, green, magenta, black, grey, orange.
  9.         // and colors should be written in this format: "color" for ex: for grey do "grey"
  10.        
  11.         // creates coordinates for line 1
  12.        
  13.         Line l1 = new Line (90, 90 ,310, 90, "blue");
  14.        
  15.         // imports line 1 x and y starting coordinates, calculating his Xe by dividing the line to 2 -
  16.         // - and get the middle of it. + setting Ye coordinate.
  17.        
  18.         Line l2 = new Line (l1.getXe(), l1.getYe(),(l1.getXe() + l1.getXs())/2 ,270 , "blue");
  19.        
  20.         // Imports l1 Xs, Xe, and l2 Xs, Xe
  21.        
  22.         Line l3 = new Line (l1.getXs(), l1.getYs() ,l2.getXe(), l2.getYe(), "blue");
  23.        
  24.         // Creates coordinates for line 4
  25.        
  26.         Line l4 = new Line (90, 210 ,310, 210, "blue");
  27.        
  28.         // imports line 4 x and y starting coordinates, calculating his Xe by dividing the line to 2 -
  29.         // - and get the middle of it. + setting Ye coordinate.
  30.        
  31.         Line l5 = new Line (l4.getXe(), l4.getYe(),(l4.getXe() + l4.getXs())/2 , 30 , "blue");
  32.        
  33.         // // Imports l4 Xs, Xe, and l5 Xs, Xe
  34.        
  35.         Line l6 = new Line (l4.getXs(), l4.getYs() ,l5.getXe(), l5.getYe(), "blue");
  36.  
  37.  
  38.        
  39.        
  40.     }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment