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 8737305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:29:25+00:00 2026-06-13T10:29:25+00:00

I have a fun dev/math’s problem that I can’t get my head around solving.

  • 0

I have a fun dev/math’s problem that I can’t get my head around solving.

See the illustration below.

End result

I have two circles of dots; one small and one big.

I want to:

  • Draw a line from any given point in the outer circle to any given point in the inner circle (done)
  • The lines should be arcs and shouldn’t cross the inner circle’s boundries or the outer circle’s boundries. (I need your help!)

fiddle!

I’ve created a jsFiddle written with RaphaelJS where i create dots and draw lines between them. See here, http://jsfiddle.net/KATT/xZVnx/9/.

It’s basically in the drawLine function I need your help, in order to draw a nice arc, instead of a straight line.

I added some helpers for working with vectors as well, se MathHelpers.Vector.

Please have a go on forking and try implementing a solution where the lines bend around the. Solutions using Béziers that actually look good is also much appreciated.

And yeah, I guess vector geometry is best suited for the calculations.

Very, very, very thankful for any help. I’ve spent a lot of time trying to solve it, but my rusty highschool math skills just aren’t enough.

  • 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-13T10:29:26+00:00Added an answer on June 13, 2026 at 10:29 am

    One option is to use elliptical arcs. This doesn’t look too awesome, but satisfies the constraints, and I think it can be improved by careful choice of the circle radius (here I used a fixed one).

    var angleDiff = MathHelpers.getAngleInCircle(innerCircleIndex, numberOfDotsInInnerCircle) - MathHelpers.getAngleInCircle(outerCircleIndex, numberOfDotsInOuterCircle);
    while (angleDiff > Math.PI) {
        angleDiff -= 2 * Math.PI;
    }
    while (angleDiff < -Math.PI) {
        angleDiff += 2 * Math.PI;
    }
    
    from = addOffsetAndRound(from);
    to = addOffsetAndRound(to);
    r = (0.5 * innerCircleRadius + 0.5 * outerCircleRadius);
    
    var pathStr = "";
    pathStr += "M" + [from.x, from.y].join(' '); // MOVE to
    pathStr += "A" + [r, r, 0, 0, angleDiff >= 0 ? 1 : 0, to.x, to.y].join(' '); // Draw line to
    var path = paper.path(pathStr);
    

    P.S. Of course, one should keep in mind that the real spiral isn’t an elliptical arc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some fun trying to get my head around some MVP stuf, as
I have a function fun that returns a double. I want to call the
I have found myself designing a language for fun that is a cross between
I have a fun addition to a project that could be a great feature
I have a fun little problem where I'm presented with a logic clause like
i have a fun svn problem. With eclipse, i have the svn plugin, and
I can do this using explode (or have fun with with strrpos ), but
Alright this is my first day with JQuery so have fun with these functions
I have a fun script: DECLARE @StartDT DATE DECLARE @MinDOS DATE DECLARE @TableName VARCHAR(50)
I have a fun issue where during application shutdown, try / catch blocks are

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.