## kemo0o

hey :

i am working on simple engineering application but i have some problem

i want to draw X-Y axis Then put any point on it .

Then i want to translate this point ∆x=5 , ∆y=12

After that i want to rotate it by angle (∂) degree

then i want to reflect it around X-axis

can any one help me ?

## Ancient Dragon 5,243

That may sound simple, but it isn't. Drawing objects such as lines, elipses etc can be very complicated depending on the operating system and compiler.

## kemo0o

That may sound simple, but it isn't. Drawing objects such as lines, elipses etc can be very complicated depending on the operating system and compiler.

So Can You help me to do that ?

## VernonDozier 2,218

Well this is the C++ forum. I'm sure you can do all of that in C++, though I have no idea how so I'm of no help if you go the C++ route. However, Java has the Swing library, which has a lot of these function written for you if you want to go that route.

## dougy83 74

You can do it through C++ (what can't you do in C++???)

There's many different ways, e.g. use graphics functions in window classes such as Qt, etc. or if using windows use the GDI WIN32 APIs directly onto the screen/window/memory bitmap/etc.

If you use Qt or some other windows classes, the code should be portable across platforms.

For the windows GDI method, check out the following functions:
GetDC, MoveToEx, LineTo, and related functions.

As for the rest of your question, translation dx = 5, dy = 12 - isn't that just adding these values to the original coordinates?

rotation by angle (assuming (0,0) is rotation origin) - you can use matrix multiplication, or simple trigonometry: e.g.
convert (x,y)-->(mag, ang)
ang += rotation_angle
convert(mag,ang)-->(x,y)

Reflecting about x axis - just make y coordinate negative

OK, so most of that was not c++ specific...

## Ancient Dragon 5,243

So Can You help me to do that ?

No, sorry, its outside my expertise.