I'm really afraid my help could be not very useful. I'm presenting a complete solution based on .NET and C#. The problem is way too simple: just a combination of two rotations. If you did not know how to calculate that, I would afraid just using the code would also be a problem. Anyway, let's try.

First of all, define a floating-point type to work with and a 2D vector with just a vector sum:

using Real = System.Double;
public struct Vector2d {
public Vector2d(Real x, Real y) { this.x = x; this.y = y; }
public static Vector2d operator +(Vector2d left, Vector2d right) {
return new Vector2d(left.X + right.X, left.Y + right.Y);
}
public Real X { get { return x; } }
public Real Y { get { return y; } }
Real x, y;
}

Now, define rotation, and only around the center {0, 0}. We will need to translate the coordinate system (using '+' defined above) anyway when we sum the rotations.

public class Rotation {
public Rotation(Real radius, Real angularVelocity, Real phase) { Initialize(radius, angularVelocity, phase); }
public Rotation(Real radius, Real angularVelocity) { Initialize(radius, angularVelocity, 0); }
public Vector2d GetPosition(Real time) {
return new Vector2d(
radius * System.Math.Cos(time * angularVelocity + initialPhase),
radius * System.Math.Sin(time * angularVelocity + initialPhase));
}
Real radius, angularVelocity, initialPhase;
void Initialize(Real radius, Real angularVelocity, Real phase) {
this.radius = radius;
this.angularVelocity = angularVelocity;
this.initialPhase = phase;
}
}

Now, I'm going to define the complex motion. Instead of definition of just two rotations, I'll define the hierarchy of unlimited rotating coordinate system: one rotation defines the center of another coordinate system, that one is also rotating, etc. In you case you will use just the array of two elements, one representing a main circle, another one — a planetary circle. So, this one will represent the hierarchy of unlimited members:

public class ComplexRotationCalculator {
public ComplexRotationCalculator(Vector2d center, params Rotation[] systems) {
this.center = center;
this.systems = systems;
}
public ComplexRotationCalculator(params Rotation[] systems) {
this.center = new Vector2d(0, 0);
this.systems = systems;
}
public Vector2d GetPosition(Real time) {
Vector2d result = center;
foreach(Rotation rotation in systems)
result += rotation.GetPosition(time);
return result;
}
public Vector2d[] GetTrajectory(Real step, uint pointNumber) {
Vector2d[] trajectory = new Vector2d[pointNumber];
for (uint index = 0; index < pointNumber; ++index)
trajectory[index] = GetPosition(index * step);
return trajectory;
}
return trajectory;
}
Vector2d center;
Rotation[] systems;
}

Basically, that's it. You can use the final

`GetPosition`

for rendering graphics immediately, or generate an array of points via

`GetTrajectory`

. This trajectory can be later imported anywhere to make the picture. I suggest to forget all the interpolations we discussed and just generate points with the step which is small enough to give an accurate picture. The speed of calculation is very high, so you can calculate many thousands of points without virtually any wait.

Let's show, for example, how to render with

`System.Graphics`

, which can be used along or with

`System.Drawing.Forms`

or anything like that. Let's add the namespace and the function calculating the trajectory in terms of points defined in this library:

using System.Drawing;
public class ComplexRotationCalculator {
public System.Drawing.PointF[] GetPointTrajectory(Real step, uint pointNumber) {
System.Drawing.PointF[] trajectory = new System.Drawing.PointF[pointNumber];
for (uint index = 0; index < pointNumber; ++index) {
Vector2d vector = GetPosition(index * step);
trajectory[index] = new System.Drawing.PointF(
(float)vector.X,
(float)vector.Y);
}
return trajectory;
}
}

Again, this rendering can be used immediately to show the rendered graphics on screen in the handle of the event

`Paint`

or, better yet, overridden method

`OnPaint`

of some control. For simplicity, I'll show rendering of some bitmap and saving it to a file:

class Sample {
static void RenderTrajectory(Graphics graphics, Pen pen, PointF[] trajectory) {
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
graphics.DrawLines(pen, trajectory);
}
static void RenderTrajectoryBitmap(Pen pen, int width, int heigh, string filename, PointF[] trajectory) {
Bitmap bitmap = new Bitmap(width, heigh, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
RenderTrajectory(Graphics.FromImage(bitmap), pen, trajectory);
bitmap.Save(filename);
}
public void Run() {
ComplexRotationCalculator calc = new ComplexRotationCalculator(
new Vector2d(300, 300),
new Rotation[] { new Rotation(200d, 1d), new Rotation(30d, 16d), });
PointF[] trajectory = calc.GetPointTrajectory(0.001, 36000);
RenderTrajectoryBitmap(Pens.White, 600, 600, "test.png", trajectory);
}
}

For further detail of rendering using

`System.Drawing`

and

`System.Windows.Forms`

, please see my past answers:

What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[

^],

Drawing Lines between mdi child forms[

^],

capture the drawing on a panel[

^].

For WPF rendering, please see:

http://msdn.microsoft.com/en-us/library/ms747393.aspx[

^].

—SA
It's not clear what you mean when you say "generate a set of curves"...

Mathematically that would mean write down an equation.

To a graphic designer that would mean draw a curve on the screen.

Which do you want? And it what language / graphics system? Specifying both C++ and Javascript makes you sound like you have no idea what you are doing.

Also, you say "...WITHOUT any orbiting/translational movement. They will simply spin in place.."

If there is no orbiting/translational movement with the circles just spinning in place, then there will only be one point of contact -- the original one -- and it won't move or describe any new curve.

Also, what is it that describes the curve? Not the point of contact.

I think you really mean that there is orbital and translational movement (which you still haven't specified exactly in your description) and the curve you are trying to describe is the curve described by a specific point on the inner circle (NOT the point of continuous contact).

The very first thing you need to learn in programming is that you need to be able to clearly and precisely specify what it is that you are trying to program. If you can't do that, it's impossible to program -- or at least impossible to say that whatever you did program is correct.

You are correct about my sounding like a novice to programing and a dunce in my communication but please see my updated question which, hopefully, clarifies my previous miscommunication. (working 16/7 induces me to be brief. I apologize for my undue brevity and imprecision. To boot, English is my 3rd language, originally Czech born. Still learning its mastery.)

To clarify, you are correct when you say "...Also, what is it that describes the curve? Not the point of contact." As is true for any plot of plane curves that are produced by rotating/orbiting circles, it is the relative motion of the original points of contact that describe/trace/plot these new curves.

Thank you again for your input.

If the two original circles just spin in place, then the original points of contact simply describe two circles when they spin.

When you say the "relative motion" of the two points, what is it you are the plotting? A two dimmensional plot of distance vs time?

Or are you plotting the position (distance and angular displacement)of one in the frame of reference of the other (irrespective of time)?

In either case, Jack Dingler's solution is a good way to go about it and relatively easy.

Is that what you are looking for?

I believe it is a form of hypocycloid plane curve I seek. Please see my updated question which includes few links to animated cycloids which should substantially clarify my question (I hope :^D ). Jack Dingler's approach is good but I am unable to do anything with it. Calculating the formula is beyond me and implementing it in a software for visual representation is doubly impossible for me.

Please see my updated question so that you may better comprehend the question.

Cheers.

***

What is the problem? It is mathematics or something else?

--SA

Вы говорите по-русски?

I have updated my question and hope it is intelligible now. Please let me know what you think.

I look forward to your reply.

With regards,

Milan K.

Let me see. I'm afraid your question could appear too big for Quick Questions & Answer forum. Also, from the tag list it's hard to see you preference of platform, language, application type, UI library to use, etc. They are optional. I would prefer to advise on .NET/C#, either with WPF or System.Windows.Forms. Do you want vector graphics or pixel, zoom or something. But let me see first. I'm not sure that you still have particular questions.

Perhaps you need to explain your particular difficulties.

Won't it be a surprise for you that I fail to see any principal challenges. In fact, this is not too hard to produce some "completely novel" set of curves it by "novel" you simply mean something which nobody pictured before in exact same configuration but might not involve any really new mathematical idea. It's obvious that a number of all possible analytical equations is countable, but still infinite. So, you can always invent some more. In does not mean it would be a novel approach or an idea...

Let me understand this: do you mean two curves "rolling" one by another without sliding (as if it could happen with high dry friction) and the curves generated by such motion? (Still, you description is not strict and not even clear. I see that authors of the answer did not get it yet exactly, neither did I.) This type of curves is pretty well known; I remember something like that...

From the first glance, the idea of approximation of such curves with smoothly stitched Bezier segment looks like a good idea. The problem is: the algorithm of presentation of curves (even the straight line) in the pixel form is pretty complex and quite slow; it usually implemented in hardware these days; using pixel algorithm would not be very feasible.

I would be more interested to know: why? Maybe this is some kind of know-how you don't wish to disclose?

--SA

Thank you for replying.

I would be satisfied with any answer in any format that I can get. Its the answer/solution I need, irregardless of the form it comes in.

You are correct in asserting/saying that it is easy to create a new set of curves because there is a near infinite combinations of equations. Mine is not a novel approach or idea. It is simply a set of curves which I've not been able to find anywhere and therefore, by definition, "new or novel".

"...Let me understand this: do you mean two curves "rolling" one by another without sliding..." It seems your definition of "rolling without friction" includes translation then I say NO that's not what is happening. Your description would fall under my definition of ORBIT in my posted question which I defined as NOT being present (not happening) in this scenario. In mechanical terms, the axis of the two circles are set in roller bearings which are set in concrete or welded to a steel plate.

To answer your question of "...Why?..." Again you are correct. I can not disclose/say it at this time. I wish I could.

--SA

The circles work as planetary gears; you fix the position of one and move another one keeping them "geared up" and trace the position of one point fixed on the moving circle. Is that right? If so, there is nothing novel in it.

If I did not understand you correctly, please explain.

--SA

As I wrote in my question, yes it is a form of cycloid where there is slippage occurring at the point of contact, which in my example is at the 12o'clock position (top).

Your "planetary gear" example is perfect BUT the gears do not "gear up" (In English we say: mesh). (I used the same example in my question :-D )

Here is an example of the type of slipping that I am talking about.

http://www.pumpschool.com/principles/vane_ani.htm

Now imagine the case/housing also rotating on its own axis in the same direction as the inner rotor. If they have the same revolutions per second or minute then there will slippage at the point of contact (12o'clock point) because the speed of each circle's circumference is different.

Понимаешь?

Now, I don't understand how they do not mesh. The teeth of the gears are either in contact or not. If they are always kept in contact, it's clear, if not -- the gear analog is probably useless and would need explanation. You would better explain it mathematically (HTML allows). You picture does not explain it fully. On it, everything is moving on a simple circular orbit. If the eccentric part was also rotating. Is it just the complex motion: inner part rotates, and the center of rotation moves in a circular motion? With slippage at the touching point or without? Then it's really a simple curve, simpler then the cycloid.

So, what's the problem? Rendering? I would just used stitched fragments of ellipses or splines, the smaller the more accurate. With WPF, closest approximation curve could be ellipse, in System.Drawing -- ellipse, Bezier or cardinal spline.

It can be a lot of work on development and some elementary mathematics, but not a challenge of a principle difficulty...

--SA

This particular example is the simplest curve I could think off. In one revolution the curve at the 12o'clock position will be downward pointing tooth. There may be a simpler curve that is produced by other parameters but that is not what I seek.

What is the problem you ask? As I stated at the beginning of my question "...I have a need to generate a set of curves which are completely novel. I am looking for both, the exact mathematical solution and its programing/graphic solution to produce the visual end product." Not knowing anything about programing and not having used higher mathematics in 30 years means that I am not up to the task. I am stuck and seeking avenues to resolve my problem. As you said, it should not be a challenge of a principle difficulty (to someone who works in those fields). I am very technically knowledgeable but not a master of all crafts. No one is. That is why I need help from the experts in those fields.

{Da, da, tavarish. I was born in Czechoslovakia and left 43 years ago at 10 years of age. I only remember a few words}

***

--SA

I have rewritten my original question which may be helpful.

Much obliged.

Milan K.

+++

More complex stuff is approximation with the primitives. First, you need to decide on the UI library. They have different set of primitives (I mentioned them all above). You can simply get approximation curve in two points (it usually works well with Bezier) and add the smoothness criteria on the ends (same derivatives as the required curve). After all, you can even approximate short fragments of the curves with the straight lines. In this case you should take short fragments.

That's basically the plan, but it is a really good amount of work. Would not really fit into the Quick Answer...

--SA

You are correct. It is a mathematical formula that I seek but I'm a Neanderthal when it comes to doing that. Is that what you mean by "primitives"? LOL

Unfortunately, that and the programing is what I need help with. Otherwise it is a good plan that you made. I like it. Anyone care to help me with it???

***

Anyway, please see my solution, which is complete. I even tested it to make sure it draws right pictures.

--SA

"Because their centers are not coincident (not the same point), their original points of contact (which started at 12o'clock in this specific scenario) will have a translation with respect to each other whose trace in one rotation is a curve that resembles one inverted point of a hypocycloid."

What does that mean? I'm sorry, this doesn't make sense to me. A 'translation' is not a point. The point of contact will always be in the same position, so doesn't produce any curve. If you wish to trace the original point of contact, you actually trace two points, one on the inner and one on the outer circle, and both are moving on a circle. You could at best trace the line connecting these two points, but that doesn't produce a curve, it produces a manifold, which cannot be easily pictured.

I also have no idea what you mean by 'inverted point of a hypocycloid': inverted how?

I still have no idea what the curve is that you wish to trace, or if in fact it is a curve you want, or a manifold? You have made your point about the circles, how they only rotate in place, how they're positioned. Tracing anything on these circles is only going to produce circles, at best. So what is it you trace?

Very good analysis, Stefan.

You are correct. Translation is not a point. But I said "...translation with respect to each other..." which means two points. After all, the two circles were initially at contact at the 12o'clock position which also denotes two points. So, at any given time, if you create a mark of the location of the original contact points which are now moving, the sum of these marks will be a trace, a curve, that will mark the places there these points were relative to each other during the circles' spins/rotations.

To put it in your terms, it is a trace of a point on the circumference of the smaller inner rotating circle with respect to the moving point on the circumference of the larger rotating circle. This is similar to how cycloid curves are produced except they are a trace of one point carrying out some motion relative to its starting point which remains stationary. Please see the animations in the webpage on Hypocycloids in my original question. Its links have other animated cycloids.

I doubt it is a "manifold" but if it is then it is a simple 2 dimensional (plane) manifold whose trace, I believe, is a pointed tooth or pointed ellipse or diamond/kite shape if the trace produces straight lines.

One way to analyze this is geometrically.

Let point A lie on the large circle and point B on the small circle located such that they are touching at time zero at the 12o'clock position. Connect A & B with a straight segment which terminates at the axis of the large circle and call this point C. After rotating both circles 90 degrees clockwise, in order for the line to connect A-C it has to pass through B which is clearly above A and C. The line has to either sharply bend at B or gradually curve to achieve this. Since this is a continuous motion and not stepped progression, the line segment A-B had to go through a gradual bending as it passed through B - a curve. After 180 degrees of rotation, points A, B, and C will be in line again. This is the trace of half of the curve. It resembles an arc of a circle or exponential curve. The other 180 degrees of rotation should produce a mirror trace which now I think might look like an ELLIPSE with pointed ends, like an American football or rugby ball or perhaps a tear drop.

If it turns out that the first 180 degrees of rotation is not a smooth curve but rather two straight segments joined at a kink, then the complete curve might look like a rhombus http://janbrett.com/games/jan_brett_geometric_shapes_diamond.htm[^] or a kite http://en.wikipedia.org/wiki/Kite_%28geometry%29[^]

+++