rect from 4 co-ordinates
in
Programming Questions
•
1 year ago
Hey,
I have 8 co-ordinates that I want to draw a rect around:
x1,y1, x2,y2
x1,y1, x2,y2
x3,y3 x4,y4
i pass x1,y1 into rect:
rect ( x1,y1, width, height )
I need to work out the width and height from the other co-ordinates and I have tried:
width = x2 - x1;
height = y1 - y3;
this doesn't seem to work but I'm not sure what the formula to work this out is...
If anyone has any Ideas I would really appreciate it as I'm stumped!
rect ( x1,y1, width, height )
I need to work out the width and height from the other co-ordinates and I have tried:
width = x2 - x1;
height = y1 - y3;
this doesn't seem to work but I'm not sure what the formula to work this out is...
If anyone has any Ideas I would really appreciate it as I'm stumped!
1