cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Ellipse (again)

Anonymous
Not applicable
Hello,
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
14 REPLIES 14
Anonymous
Not applicable
Hello James,
Very interesting indeed.
In all the math sites I have gone to it is always stated
that a circle is a special case of an ellipse where the
the foci are coincident at 0,0 or the center of the ellipse.
I would suggest that one could say that if the major axis
and minor axis are equal then the ellipse is a circle.

On the subject of a mathematical proof that the mul command
operating on a circle results in a true ellipse, a man
posted to GDL TALK the following code for drawing
an ellipse.


gosub 10
rot2 180
gosub 10
end

10:
for i=-1 to 1 step .05
hotspot2 i, b*sqr(1-(i*i/a*a))
next i
return

I don't understand this code yet
but it appears to be in the form
where the "Y" values are calculated
by multiplying by a factor.

I have asked this person to show the
steps in the derivation of this code.

Thanks,
Peter Devlin
LiHigh
Newcomer
y=b*sqr(1-(i*i/a*a))
Peter, this equation is equivalent to what we have here.

Again, I believe strectched-circle is an ellipse.

In order to proof it, we must first define what is an ellipse. The foolowing definition is quoted fron Answer.com:

A plane curve, especially:
1. A conic section whose plane is not parallel to the axis, base, or generatrix of the intersected cone.
2. The locus of points for which the sum of the distances from each point to two fixed points is equal.

An ellipse may be uniformly stretched along any axis, in or out of the plane of the ellipse, and it will still be an ellipse. The stretched ellipse will have different properties (perhaps changed eccentricity and semi-major axis length, for instance), but it will still be an ellipse (or a degenerate ellipse: a circle or a line). Similarly, any oblique projection onto a plane results in a conic section. If the projection is a closed curve on the plane, then the curve is an ellipse or a degenerate ellipse.

Howard Phua

Win 10, Archicad 19 INT
Anonymous
Not applicable
Hello LiHigh,
Then you agree, this man's code is in the form
where y values are multiplied by a factor just like Mul .
Then we have a proof that a mul operation performed
on the values along one axis of a circle
indeed generates a true ellipse.

To be complete, all that needs to be done is transform
this equation y=b*sqr(1-(i*i/a*a))
into the Cartesian equation for an ellipse.

Intuitively, it seemed that it had to be true
but I had not satisfied myself that it could be proved.

I, for one, am relieved and pleased.

Thank you LiHigh,
Peter Devlin
Fabrizio Diodati
Graphisoft Alumni
Graphisoft Alumni
Hi Peter,

try the attached one, is a "dirty" experiment made in some minutes... it can be improved but it could be a could start for you.

Friendly
Fabrizio
Fabrizio Diodati
Graphisoft Italy Srl | Via Rossignago 2/A Spinea Venezia 30038 Italy
Anonymous
Not applicable
Hello Fabrizio,
Thank you for the object.
Nice touch with the extra hotspots where the curve gets tight.
The object is drawn using the Cartesian equation for an ellipse
I have several of them now including a few I have made.

The man who wrote the code that used the equation
y=b*sqr(1-(i*i/a*a))
posted back with the derivation. He said:

Hello peter

thse script is derived from x^2/a^2 + y^2/b^2 = 1

x^2/a^2 + y^2/b^2 = 1
y^2/b^2=1-x^2/a^2
y^2=(1-x^2/a^2)/b^2
y=sqr((1-x^2/a^2)*b^2)
y=sqr((1-x^2/a^2))*b
y=b*sqr((1-x^2/a^2))

replace y and x by i
and the result is

i, b*sqr(1-(i^2/a^2))

Regards...
Eric Wilk
Webmaster FC-CadLink.com


So the proof is complete.

Peter Devlin