Mirroring a vector

Blitz3D Forums/Blitz3D Programming/Mirroring a vector

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Given a vector, anyone know the quickest way to mirror it, using maths?

Let's use 2D (x,y) to make it simpler: say I have a vector x=-1 y=1 and I want to mirror it so it becomes x=1 y=1. In this instance I can just negate the x but I want it to work whatever the vector. e.g. with x=0 y=1, negating the x makes no difference, I want it to become x=0 y=-1.

I know I could use TFormVector on a pivot or something, but I want to find a quicker(?) way using maths.

Cheers.

[edit]Yikes. I guess this isn't going to be a simple as I'd hoped because I need to figure into the equation the axis I want to mirror around. :/