Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import canvasML.*;
- public class line {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- // public Line (int xPosition, int yPosition, int xEnd, int yEnd, String color)
- // valids colors are: red, yellow, blue, green, magenta, black, grey, orange.
- // and colors should be written in this format: "color" for ex: for grey do "grey"
- // creates coordinates for line 1
- Line l1 = new Line (90, 90 ,310, 90, "blue");
- // imports line 1 x and y starting coordinates, calculating his Xe by dividing the line to 2 -
- // - and get the middle of it. + setting Ye coordinate.
- Line l2 = new Line (l1.getXe(), l1.getYe(),(l1.getXe() + l1.getXs())/2 ,270 , "blue");
- // Imports l1 Xs, Xe, and l2 Xs, Xe
- Line l3 = new Line (l1.getXs(), l1.getYs() ,l2.getXe(), l2.getYe(), "blue");
- // Creates coordinates for line 4
- Line l4 = new Line (90, 210 ,310, 210, "blue");
- // imports line 4 x and y starting coordinates, calculating his Xe by dividing the line to 2 -
- // - and get the middle of it. + setting Ye coordinate.
- Line l5 = new Line (l4.getXe(), l4.getYe(),(l4.getXe() + l4.getXs())/2 , 30 , "blue");
- // // Imports l4 Xs, Xe, and l5 Xs, Xe
- Line l6 = new Line (l4.getXs(), l4.getYs() ,l5.getXe(), l5.getYe(), "blue");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment