pouët.net

angle curves- new kind of mathematical curves I made

category: code [glöplog]
Hi, I would like to present to you an alternative to Bezier curves. I created those curves few days ago and now I decided to share it to the public. The detailed description is in the http://www.hit8b.it/un8bg30.html . There's also an interactive presentation in javascript under http://hit8b.it/anglecurves.html. The biggest advantage of this curve is the fact one need just 7 multiplications to calculate the point ( probably only even 5) comparing to Beziers with 28 multiplications. The formula is also quite easy also.BB Image
added on the 2015-05-11 20:35:26 by gorgh gorgh
I don't understand shit about this stuff but the paradox embedded in an "angle curve" is cool per se.
added on the 2015-05-11 21:18:39 by dixan dixan
the basic idea one really only need to know is that any curve can be divided into smaller curves that can be represent by part of a circle less than 1/2 of a circle. For example straight line would be represent by 0 -> 0.0001 angle of a circle . The second important thing is the fact that we have to bent this section of a circle and it's all.
added on the 2015-05-11 21:29:59 by gorgh gorgh
Well, we use such kind of abstract stuff everywhere in demos since decades...but seems quite usable, so good job! :)
(As in a job you won´t ever come up with such stuff, but in demoscene there are no limits, invent and win! :D )
Also reminded me of having to use/invent even more abstract formulas to animate stuff once again! Thanks for that! ;)
thanks for kind words :)
added on the 2015-05-11 22:37:34 by gorgh gorgh
You are welcome! :)
Maybe we should bury all our code into the "random line of code thread", so only the people who deserve it also get it! ;) Coders are somehow misaligned nowadays!
Code:even ;Amiga-Leftover(ASMone) to atleast always break even
reminds me of fillet curves?
added on the 2015-05-11 22:55:03 by Maali Maali
How is this supposed to be different from bog-standard SVG ArcTo commands?

Besides, it's not cheaper than beziers at all; quadric beziers require only three multiplications and no trigonometry. I have no idea where you got your "28 multiplies" figure from, but it's wrong.
added on the 2015-05-11 23:02:05 by kusma kusma
Maali: yeah, I didn't knew that curve, but probably those curves don't compose splines, or I'm wrong.
Kusma: I calculated the number of multiplications quicky from Bezier formula C1 C2 C3 C4.
added on the 2015-05-11 23:10:29 by gorgh gorgh
http://stackoverflow.com/questions/5634460/quadratic-bezier-curve-calculate-poin t
according to this source it still takes 14 multiplications to draw a point with quadratic bezier curves.
I don't know arcTo function but I suppose it doesn't include bending of the curve, and it's probably based on Beziers.
added on the 2015-05-11 23:26:09 by gorgh gorgh
Note that a bunch of those multiplications are the same. And you can reformulate your coefficients to optimize away some of them. My figure of 3 was for a 1d evaluation, so that was not quite right in this case. But still, you should be able to end up with:

tt = t * t;
x = ax * tt + bx * t + cx;
y = ay * tt + by * t + cy;

i.e two second degree polynomials, solved for the same t. That's 5 multiplies.

And no, the ArcTo command in SVG is not based on Beziers, although most SVG implementations probably approximate them with Beziers for performance reasons.
added on the 2015-05-11 23:55:08 by kusma kusma
Kusma: I guess you can use incremental cos/sin calculation to speed-up ArcTo, so you can replace trigonometric stuff with few adds/muls.
And as far as I can tell this curve is actually interpolating two arcs, am I right?

Grgh: it's nice to see someone playing with math/curves, but I hope you do realize that saying "a new kind of curve" is pretty bold statement and would be challanged by others ?

And you know - the burden of the proof is all on you, as they say, so you have to make an extensive study of existing literature/comparison, not us (i.e. nobody have time for that), and then, if you find novelty in your solution, you can finally come up with such a bold statement.

I usually recommend this website as a good example what can go wrong with delusional thinking of a researcher on an ego-trip ;)
Also I think it's actually nothing to be ashamed of - it really can happen to anyone, just it is worth to remember to chill-down, before you do bigger mistake and say post something on arXiv and millions of random people will laugh at it ;)
added on the 2015-05-12 00:26:42 by tomkh tomkh
Kusma: forgot a link to incremental sine/cosine. Also you can obviously use rational bezier splines to represent a circular arc (not just approximate), but it would be slower than incremental sine/cosine.
added on the 2015-05-12 00:37:58 by tomkh tomkh
@tomkh:
If you ask me - no, this curve is not interpolating two arcs.
As for the study: I examined most of the 827 curves described in here http://www.2dcurves.com/ and haven't found any similar one, I also checked internet for different splines.
added on the 2015-05-12 00:40:03 by gorgh gorgh
sorry,939
added on the 2015-05-12 00:44:07 by gorgh gorgh
currently it doesn't work in Chrome, Firefox and Safari, so I presume that there is some live mid-night coding/testing going on? otherwise, i'm out of browsers to test it on.
added on the 2015-05-12 01:09:00 by bonefish bonefish
probably it has something to do with the mouse event, that's the only thing that could go wrong, the non-curve code is very simple. I'll fix that tomorrow.
added on the 2015-05-12 01:18:18 by gorgh gorgh
Grgh: even if it is not listed on this 2dcurves website (but I actually don't see NURBS or say non-stationary interpolatory subdivision schemes there), there are actually infinite many ways of calculating a smooth function (with say 1st/2nd continuous derivative) going through an ordered set of points.
I see your curve is more like rotating a skewed circular arc by an angle (precalculated and fixed per segment) rather than interpolating two arcs. But anyway, is there anything special about it? Does it have some useful properties? And no, I don't think it's faster than quadratic bezier (as Kusma pointed out), even with incremental sine/cosine.

Anyway, I'm just saying your results might be preliminary, maybe it's an interseting direction, just it is not uncommon people get overexcited about their your research.
added on the 2015-05-12 01:20:15 by tomkh tomkh
yeah,thanks for your opinion, I might be too overexcited about it just as you said, and it actually it might not be faster than quadratic beziers. But I used to work as a graphician and had a lot of contact with beziers and I just thought that a curve where you add points directly without control points would be something interesting and easier to use. If there are so many splines so why are beziers and NURBS so popular? I just find it impossible that there is some other useful formula for generating vectors.
added on the 2015-05-12 01:35:07 by gorgh gorgh
A cubic interpolating spline usually does the job and is way smoother.
added on the 2015-05-12 02:17:32 by las las
smoothness is something to improve, the curve itself is as smooth as Hermite.
Hey, it may have it's flaws, but at least everything shows that it's something creative, which is something not so many people achieve :)
added on the 2015-05-12 02:32:06 by gorgh gorgh
grgh: In general: CAD-software used bezier curves like this for industrial manufacturing 20-30 years back, and still is. numerical analytic research has been done on it since it was first invented in the late 60's. Just talking a little about why the popularity. Its math is fairly easy to do for a novice programmer who wants to approximate surfaces by a given set of points. 3D-modelling software inherited this from CAD and people in the 3D graphics industry use these to make surfaces easily.
added on the 2015-05-12 02:47:57 by rudi rudi
Quote:

tt = t * t;
x = ax * tt + bx * t + cx;
y = ay * tt + by * t + cy;

i.e two second degree polynomials, solved for the same t. That's 5 multiplies.


Or you can optimize it further to only 4 multiplications:

Code: x = (ax * t + bx) * t + cx; y = (ay * t + by) * t + cy;
I would love to see you generalize this to three or more dimensions.
added on the 2015-05-12 09:50:47 by Preacher Preacher
PulkoMandy: Good point, yeah.
added on the 2015-05-12 10:15:32 by kusma kusma

login