wxEcMath - Official documentation  0.6.4
Syntax to load a curve

With wxEcPlot, you can draw 4 types of curves :

To parse a formula automatically, a syntax must be adopted. You can restrict the definition of the curve by using wildcards. Because of theta, parametric and polar curves will be restricted in any case.

These strings must be parsed using wxEcCurve::Parse(), but you can also define a wxEcCurve on your own via the constructor or the methods (required for wxECT_CLOUD).

If the expression is polar, wxEcCurve::Parse() takes a second parameter ! Else it will be considered as being parametric.

As you can see :

If no domain is given, default values will be chosen. The use of the range will be set accordingly.

When you parse an expression, a default colour is randomly chosen among twenty pre-defined colours. It is a good thing to randomize this automatic choice in your wxApp::OnInit() :


When dealing with a point cloud, you will have to define the curve on your own (data, style, color...). Let's see how to do with a shortened sample :

#include "ec_defs.h"
#include "ec_engine.h"
#include "ec_plot.h"
class myShortenedClass
wxEcPlot *m_plot;
wxRealPoint m_cloud[10];
void CreateCloud()
wxEcCurve curve(wxEmptyString, wxEmptyString, wxECT_CLOUD, *wxRED, 1, false, false, 0, 10, 10, &(m_cloud[0]));

As the cloud uses a pointer, any modification in m_cloud will affect the plot. Do use wxEcPlot::Refresh() to update your view. It is not sure it will be performed automatically.

The number of points declared in wxEcCurve::NumPoints must be lower or equal than the capacity of your buffer. If not, it will result in unexpected bugs.

Documentation generated with Doxygen 1.8.10
Hosted on :
Get wxEcMath at SourceForge.net