Class interfaces and operands

Does one have to make a specific interface for assignment?

 classfoo monkeys;
classfoo gorillas;
monkeys = gorillas;

I am developing a class to approximate a bezier curve based on the SVG definition begin x, y end x,y and control point x,y. As I ieterate the midpoints I have to exchange extrapolated endpoints and control points and I am getting some odd returns. below is the ieteration code:

BezierQuadradic::BezierQuadradic(fPoint begin, fPoint finish, fPoint cPoint, int ArcResolution)
	{
		fPoint _InterL;
		fPoint _InterR;
		fPoint _Curve;
		fPoint _begin;
		fPoint _finish;
		fPoint _cPoint;
		_begin = begin;
		_finish = finish;
		_cPoint = cPoint;
		
		this->CList[0] = begin;
		this->CList[39] = finish;
		if (ArcResolution > 5 ? ArcResolution:5);
		// Compute curve between curve entry and apogee.
		for(int i=19;i>=1;i--)
			{
				_InterL = this->PointMedian(_begin, _cPoint);
				_InterR = this->PointMedian(_cPoint, _finish);
				_Curve = this->PointMedian(_InterL, _InterR);
				_finish = _Curve;
				_cPoint = _InterL;
				this->CList[i] = _Curve;
			}
		// Compute curve between curve apogee and finish.
		_begin = begin;
		_finish = finish;
		for(int i=20;i<=39;i++)
			{
				_InterL = this->PointMedian(_begin, _cPoint);
				_InterR = this->PointMedian(_cPoint, _finish);
				_Curve = this->PointMedian(_InterL, _InterR);
				_begin = _Curve;
				_cPoint = _InterR;
				this->CList[i] = _Curve;
			}
	}
fPoint BezierQuadradic::PointMedian(fPoint _In, fPoint _Out)
	{
		fPoint _temp;
		_temp.X = ((_In.X - _Out.X)/(float) 2) + _In.X;
		_temp.Y = ((_In.Y - _Out.Y)/(float) 2) + _In.Y;
		return _temp;
	}

the definition of a float point (fPoint):

	typedef struct fPoint
		{
			float X;
			float Y;
		}fPoint;

Can you show us what your getting as an output?

I am developing a class to approximate a bezier curve based on the SVG definition

How is this:

 classfoo monkeys;
classfoo gorillas;
monkeys = gorillas;

related?

		fPoint _begin;
		fPoint _finish;
		fPoint _cPoint;
		_begin = begin;
		_finish = finish;
		_cPoint = cPoint;

Do you really need 6 lines to accomplish what could be done in 3? What is a fPoint? If it's an instance of a class, does the class have an equal operator defined?

(Never mind. I read to the end, and I see that fPoint does not have an equal operator. If you really want control of what fPoint does, you'll make it a class and implement the equal operator.)

		this->CList[0] = begin;
		this->CList[39] = finish;

this-> is not needed. What is CList? Are there really 40 fPoint elements in the array?

The assignment of an instance of a class, to another instance, is problematical, and one that you can read all about.

It works for some classes, and it doesn't work for others. All sorts of potential issues related to maintaining the appropriate links to other objects arise. You can write specific assignment operator functions and copy operator functions to handle these difficulties. It is a complicated area.

I can't think of any project I would contemplate using an Arduino for, for which you would want to buy into all of the trouble, unless you are an expert who knows what you are doing.

Yes Paul, 40 elements. A bezier quadratic is describing a curve whose intercept is the midpoint of the line spanning the midpoints of the lines formed between begin and control point, and control point to finish.
As to

Code:
fPoint _begin;
fPoint _finish;
fPoint _cPoint;
_begin = begin;
_finish = finish;
_cPoint = cPoint;
Do you really need 6 lines to accomplish what could be done in 3? What is a fPoint? If it's an instance of a class, does the class have an equal operator defined?

Yes as each iteration loop one for left of the apogee and one for the right alters the begin, finish, and control points as the extrapolation progresses toward the begin and finish points. fPoint is not a class per say but a user defined type structure. The purpose is to reasonably accurately render SVG paths on the CNC machine so the file can be read, rendered, and sent to my motor control routines as simple line vectors.

Yes as each iteration loop one for left of the apogee and one for the right alters the begin, finish, and control points as the extrapolation progresses toward the begin and finish points.

Wrong.

fPoint _begin = begin;
fPoint _finish = finish;
fPoint _cPoint = cPoint;

Does EXACTLY the same thing, in half as many lines.

What difference is there other than in compiled source code length? Assignment is assignment.

The definition of a float point (fPoint):
typedef struct fPoint...

So you think you're having problems with assignment of "point" structures?
You certainly SHOULD NOT need to implement any special assignment methods; being able to assign/pass/etc structures is a simple C-level feature, no C++ should be needed.

What I can see in the code you posted shows a rather alarmingly large data structure (408 bytes in clist, plus ~108 bytes as temporaries or arguments, about 400 bytes), and I can't see all of BezierQuadradic, so there might be more. It could be that you're simply running out of memory (on the stack, especially), which can cause weird behavior.

I'm not familiar with the algorithms, but it certainly looks like some of your variables could be pointers to points (2 bytes) instead of point structures (8 bytes), which would probably be much easier for the compiler to deal with. (Alas, probably not clist itself.)

Can you shrink your code to a small and self-sufficient sketch that demonstrates the problem?
It might be time to look at the code that is being produced...

It was a math error in the PointMedian function. I was subtracting out from in when I needed to subtract the in from the out.
I duplicated the code in VBA in an Excel sheet so I could easily view all of the computations.