Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8252395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:33:18+00:00 2026-06-08T00:33:18+00:00

Has anyone seen a decent drawing algorithm for cornu spirals (aka, clothoids) or splines?

  • 0

Has anyone seen a decent drawing algorithm for cornu spirals (aka, clothoids) or splines? For arcs and lines we have things like Bresenham’s algorithm. Is that adaptable to clothoids?

The Wikipedia page has this Sage code:

p = integral(taylor(cos(L^2), L, 0, 12), L)
q = integral(taylor(sin(L^2), L, 0, 12), L)
r1 = parametric_plot([p, q], (L, 0, 1), color = 'red')

Is there any example code for parametric plots available? I’m not seeing much with my web searches.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:33:19+00:00Added an answer on June 8, 2026 at 12:33 am

    I didn’t see any existing high-speed algorithm for this. However, I did come to understand the common method for drawing things like this. Essentially, you recursively split the L until the left, mid, and right points calculated are close enough to a straight line that you can draw that line. I was able to use the MathNet.Numerics.dll for the integration. Some code:

        public static void DrawClothoidAtOrigin(List<Point> lineEndpoints, Point left, Point right, double a, double lengthToMidpoint, double offsetToMidpoint = 0.0)
        {
            // the start point and end point are passed in; calculate the midpoint
            // then, if we're close enough to a straight line, add that line (aka, the right end point) to the list
            // otherwise split left and right
    
            var midpoint = new Point(a * C(lengthToMidpoint + offsetToMidpoint), a * S(lengthToMidpoint + offsetToMidpoint));
            var nearest = NearestPointOnLine(left, right, midpoint, false);
            if (Distance(midpoint, nearest) < 0.4)
            {
                lineEndpoints.Add(right);
                return;
            }
            DrawClothoidAtOrigin(lineEndpoints, left, midpoint, a, lengthToMidpoint * 0.5, offsetToMidpoint);
            DrawClothoidAtOrigin(lineEndpoints, midpoint, right, a, lengthToMidpoint * 0.5, offsetToMidpoint + lengthToMidpoint);
        }
    
        private static double Distance(Point a, Point b)
        {
            var x = a.X - b.X;
            var y = a.Y - b.Y;
            return Math.Sqrt(x * x + y * y);
        }
    
        private static readonly double PI_N2 = Math.Pow(Math.PI * 2.0, -0.5);
    
        public static double C(double theta)
        {
            return Integrate.OnClosedInterval(d => Math.Cos(d) / Math.Sqrt(d), 0.0, theta) / PI_N2;
        }
    
        public static double S(double theta)
        {
            return Integrate.OnClosedInterval(d => Math.Sin(d) / Math.Sqrt(d), 0.0, theta) / PI_N2;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone seen any image deskew algorithms in c#? I have found: http://www.codeproject.com/KB/graphics/Deskew_an_Image.aspx but
Has anyone seen or have an idea on how to go about creating widget
Has anyone seen iPad greeting cards app... what they have done is released the
Has anyone seen this error when working with a PHP application out of dynamic
Has anyone seen JavaMail not sending proper MimeMessages to an SMTP server, depending on
Has anyone seen rendering glitches with Papervision? Please seee the flash movie at http://www.mapopolis.com/test/
Has anyone seen an open-source library that produces charts similar to Github.com's commit timeline
Has anyone seen this: ?? No jgem command works at all?? Though jruby -S
Has anyone seen or compiled benchmarks comparing declarative (XML) versus programmatically created UI's in
Has anyone ever seen this? I don't how to expand on this. It's the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.