usingMaths.com
Demonstrating and showing pupils and students one application of Mathematics.







<< PreviousNext >>

Graphs like C++ Window Frame




Cartesian Plane

The Cartesian Plane is the usual graph surface we are taught in school.
It consists of the x and y axes.

In C++, drawing is done on a window frame --actually, drawing is done on some sort of graphic context beforehand, then transferred to the screen.

Drawing may be done between calls to BeginPaint() and EndPaint() or GetDC() and ReleaseDC().

Whichever way, there is a subtle difference between the way we use graphs naturally and the C++ graphic context (window frame):
The y-axis of the C++ window frame is measured from the top and increases as you move downwards.

Graph/Frame  Comparism


Drawing on the C++ Window Frame

In C++, the Window Frame would represent something like a graph book; and this graph book is plotted or drawn on using code.

Create a new cplusplus project; call it Dymetric.

Type out the adjoining C++ code to see what the Window Frame feels like.



Note: The bulk of the adjoining code is automatically generated by the Visual Studio IDE, all you just have to do is to fill in what we have added to generated code.

To help make the filling in easier, and harder to miss any added code, we have marked out all the code parts we added with the delimiters (separators)
/*PoI* ____________________________________ *PoI*/                .
               .
               .
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/


(We've used PoI to mean Point of Interest here.)










<< PreviousNext >>