So I have to scale down a triangle in space to have a preset hypotinuse (i.e. shrinking a line and keeping the angle).
initially I came up with (see case1.bmp).
but this only allows for triangles in northwest. so I came up with (see case2b.bmp) to output the point on bothe sides.
I have now hit the problem of if the moving point (Mx,My) has the same x value as the start point (Sx,Sy) then my method for picking the side becomes 0/0 which throws up errors everywhere.
Anyone have an alternative method of doing this or have an equation that if a<b=1 and if a>b=1? (I don't care what happens when a=b (0/0) because cos(Theta) will be 0 anyway.)
initially I came up with (see case1.bmp).
but this only allows for triangles in northwest. so I came up with (see case2b.bmp) to output the point on bothe sides.
I have now hit the problem of if the moving point (Mx,My) has the same x value as the start point (Sx,Sy) then my method for picking the side becomes 0/0 which throws up errors everywhere.
Anyone have an alternative method of doing this or have an equation that if a<b=1 and if a>b=1? (I don't care what happens when a=b (0/0) because cos(Theta) will be 0 anyway.)
Attachments

899.4 KB Views: 12

61.9 KB Views: 6