http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GP: Flipping a point across a line: possible answers



On Wed 01 Sep, Kamel Serend wrote:
> I have not learned how to do it, but I would say that if your line has a
> directing vector defined as v ( a,b )
> you could use the vector normal to this line v'( -b,a ), compute the
> intersection I of the new line passing through your point P
> with the original one, then you define the PI vector, a simply translate
> the co-ordinates of P by 2*PI.
> That is my first guess.
> Another method would maybe involve transforming the "miror" line into
> one of the major axis and the P point into a P' one using the same
> transformation, compute the mirroring P'' and use the inverse of the
> transformation to find the real transformed co-ordinates of P thanks to
> the line, but I do not want to get involved in such calculations.

Er, Sorry Kamel, I don't follow any of that.  I'm not really a
mathematician.  I know, I'm quite thick here.

Please could you provide a little pseudo-code, please please please???
Simple code would probably be best!  (Considering my lack of brains.)

Ps: I'm trying to do this code as simply as possible, so as to keep complex
maths, such as long equations involving SIN's etc., to get the code fast.

Again: Sorry for being such a dunce.


Regards,

Matt. W.
-- 
***  eudoxus@freeuk.com  ***  http://members.xoom.com/eudoxusM/
                 mwebster@apsoft.co.uk

=================================================================
To SUBSCRIBE or UNSUBSCRIBE please visit
http://gameprogrammer.com/mailinglist.html