- #1
xovangam
- 18
- 0
in some work I'm doing i have a 2D rectangle that can be rotated and/or translated in any direction in 2D space. for example it might look like this:
i would like for that to map to another smaller 2D rectangle that has its origin fixed at the top left corner. such that if i pick some point (P) that's on the larger rectangle i want to map it to the coordinate space of the smaller rectangle:
not quite sure how to go about setting that up...any thoughts?
TIA
Code:
(x=30,y=-10) +-----------+ (x=30,y=2) +-- +y
| | |
| *P | -x
(x=20,y=-10) +-----------+ (x=20,y=2)
i would like for that to map to another smaller 2D rectangle that has its origin fixed at the top left corner. such that if i pick some point (P) that's on the larger rectangle i want to map it to the coordinate space of the smaller rectangle:
Code:
(x=0,y=0) +-------+ (x=5,y=0) +-- +x
| | |
| *P | +y
(x=0,y=3) +-------+ (x=5,y=3)
not quite sure how to go about setting that up...any thoughts?
TIA