Ellipse (again)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-07-12 02:59 AM
Today I was informed by Tom Waltz that using the MUL2 command
in a 2D script on a command that draws a circle such as CIRCLE2
does not make a true ellipse but an approximation.
I did a search on GDL TALK using the key word "ellipse"
and found a post by Alex Schamenek the text of which follows.
-------------------------------------------------------------------------------------
"Okay, now I really need to create an ellipse. I know you can fake one by using
MUL2 with a circle, but when you explode a stretched object, anything round gets
faceted. So I can't just use a MUL2 statement to convert a circle into an
ellipse.
So PLEASE Graphisoft!!! Provide a way for us script an ellipse, without MUL
transformations!!!!"
-------------------------------------------------------------------------------------
I don't know how many scripts by many different people
I have seen that use either the 3D command MUL or
the 2D command MUL2 to change a circular object or figure into an elliptical shape.
So I am not the ownly one that thought that using a MUL command
on a circular shape produced an elliptical shape.
The Cartesian formula for an ellipse is
"x" squared over "a" squared plus "y" squared over "b" squared equals one
I have used this formula to find the the x and y coordinates
for points along elliptical curves in several GDL scripts.
I am not mathematical enough to write a formula that
describes the resultant shape of a circle whose "Y" coordinate values
for all points has been multiplied by some factor and then
compare this formula with the Cartesian formula to see if
they are equivalent.
Does any one have more information on these issues ?
If what happens when a circular shape is distorted
using a Mul command does not produce an ellipse then
what does it produce and what is the difference between it
and a true ellipse ?
Or, said another way, does anyone know how to write a formula that
describes the resultant shape of a circle whose "Y" coordinate values
for all points have been multiplied by some factor ?
Thank you,
Peter Devlin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-07-12 06:18 AM
the scripts shall look like this:
--------------------------------------------------
a0=a/2
b0=b/2
c=SQR(a0^2-b0^2)
DIM x_pos[],y_pos[]
n=20
delta_x=a/n
FOR u=1 TO 2
FOR i=1 TO n+1
x_pos
y_pos
hotspot2 x_pos
NEXT i
MUL2 1,-1
NEXT u
---------------------------------------------------------------------------

Win 10, Archicad 19 INT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-07-12 06:35 AM
Thank you for posting back.
It is going to take me a while to understand your script
because, as I said, I am not very mathematical.
I'm going to copy your script into the 2D script of a new object
and see if I can figure it out.
Do you know whether a circular shape operated on
by a MUL command produces a true ellipse or some other shape ?
Thank you,
Peter Devlin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-07-12 07:02 AM
I think I understand your script now.
I have written something quite similar
using the ellipse formula except I did not use an array
but used put and get and drew the ellipse as lines segments.
I used a much larger "n" value to make the arc look smoother.
Using the ellipse formula to draw an ellipse does not answer
the question about whether an ellipse drawn by MULing a circle
is the same shape (meaning a true ellipse).
Thank you,
Peter Devlin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-07-12 07:57 AM
I don't have a proof for it, but intuitively it seems to me that the mul statement should produce a true ellipse. Since an ellipse is just a circle viewed obliquely it makes sense to me that this would be equivalent to a uniform distortion along one axis. There may even be a simple geometric proof for this but I am too tired to think about it right now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-07-12 08:16 AM
Peter wrote:Oh! sorry, I tought you're talking about the formula.
Hello LiHigh,
I think I understand your script now.
I have written something quite similar
using the ellipse formula except I did not use an array
but used put and get and drew the ellipse as lines segments.
I used a much larger "n" value to make the arc look smoother.
Using the ellipse formula to draw an ellipse does not answer
the question about whether an ellipse drawn by MULing a circle
is the same shape (meaning a true ellipse).
Thank you,
Peter Devlin
I think ellipse drawn by MULing a circle
is infact a true ellipse.
You can double check by adding a equal-size stretched circle to the above script.
Win 10, Archicad 19 INT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-07-12 08:21 AM
If you use openGL for the 2D-views: I have mentioned some aberrations if you zoom in a very large scale.
If you explode an ellipse object the resulting segment lines (!) can't be a true ellipse, but if you draw the ellipse inside the script not by mul2 but by the formula it wouldn't be even correct as proper object.
There was a long thread about the ellipse issue on german GDL Talk. It was for creating true elliptical shapes with prism_ without the mul command. We tried to appriximate with arcs. This works not bad. Not really exact, but very less points than the iterative way with polylines. (For this the EllipsePro object was written for. A case study.)
My advice: Use MUL and MUL2.
MHO: Tom fails here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-07-12 02:25 PM
Link. "If the major and minor axes are equal, the ellipse is a circle. Shall we define an ellipse as a distorted circle, then, or the circle as a special case of the ellipse? Either one would be reasonable and useful."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-07-12 10:34 PM
There seems to be a consensus here that
using the MUL commands on a circular element
results in a true ellipse.
I have done the test of placing an instance of an object
that draws an ellipse by MULing a circle and then making
an ellipse with the circle tool with the same dimensions
as the object and it appears that the two exactly coincide.
That they appear to be the same, to me, does not prove
that they are indeed the same.
I wish I could figure out a way of writing a formula/equation
that mimics what happens when distance values along
one axis have a multiplication factor applied to them.
Or, more satisfying to me, Matthew's suggestion
of a geometric proof.
I wish I could read German so I could read the
discussion Frank referred to. It sounds fascinating.
It appears that, for the moment, we have a consensus
but not a proof.
I thank you all for your interest and commentary.
Peter Devlin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-07-13 01:40 AM
This looks like a proof. "In other words, an ellipse is the projection of a circle." Step by step from ellipse equation to circle equation.
Interesting.