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 ?

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.

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 ?

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...

This article has been dead for over six months. Start a new discussion instead.