forum.alglib.net

ALGLIB forum
It is currently Thu Mar 28, 2024 8:31 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Fastest "curve over set of points" (no polynoms)
PostPosted: Mon Jun 11, 2012 10:43 am 
Offline

Joined: Mon Jun 11, 2012 9:56 am
Posts: 1
Hello!

Time to time, I'm working on "curve over set of points". And few days ago I found very easy and fast way to build a curve over points. Not sure that it's new one, but never seen it before. Of course, it can be another invention of bicycle. So, would be interesting to know: Is it something new or not?
Now algorithm. It works by generating two additional point on every segment in one pass. It processes corner by corner.

Attachment:
logic.jpg
logic.jpg [ 31.61 KiB | Viewed 3618 times ]



Let see how it processes one corner with three points A B C.
1. Calculate location of additional point "e" located on segment [AB]. Distance from "B " to "e" is 1/3 of segment [AB] length.
2. Calculate location of additional point "f" located on segment [BC]. Distance from "B " to "f" is 1/3 of segment [BC] length.
3. Find a pseudo centroid point "D" of triangle [eBf]. At first time, I just use real centroid, but for best results it should be shifted.
4. Calculate distance and direction to shift "D" point to position of "B" point. Use calculated values to shift "e" and "f" , it produces "A1" and "C1" points.
5. "A1", "B" and "C1" points - is new points of curve.
Here is results (two passes)

Attachment:
demo.jpg
demo.jpg [ 68.49 KiB | Viewed 3618 times ]


And with nodes
Attachment:
demo1.jpg
demo1.jpg [ 45.85 KiB | Viewed 3618 times ]


Best regards,
Igor Tyugay.

PS: there is no any problems to use same logic to work with 3D curves.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 56 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group