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

  • SEARCH
  • Home
  • 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 8204179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:49:00+00:00 2026-06-07T07:49:00+00:00

Please bear with me – I’m finding this very difficult to explain. This is

  • 0

Please bear with me – I’m finding this very difficult to explain.

This is more of a trigonometry question but for what it matters, this is in JavaScript/KineticJS.

I have a series of ‘group’s which contain ‘line’s and ‘handle’s. The way this has to work, it works best for every group to have its own coordinate plane. The problem I’m asking for help on is the only instance where this solution is not ideal.

As these groups rotate, their coordinate plane also rotates. This allows the group object to be reused and its children can measure from the group’s origin without any concern about the parent group’s orientation. Up is always up… it doesn’t matter which way my group is facing.

I’m a new poster, so I cant add an image. However, I think seeing it is vital. Please see https://i.stack.imgur.com/QAzVH.png

The goal is to attach the unattached point of the red arc (‘handle’) to the black dot on the blue line (‘line’). I’ve set it to always draw 90 degrees just for demonstration purposes.

Despite convention, the API I’m using rotates clockwise, giving the red line an angle of 0, the yellow line an angle of 116, green 180, and blue 296 – all relative to the same origin in the top left of the screen. These angles change, so I’m looking for the formula to calculate the new end point of the red handle.

The X-axis always travels straight down the middle of each line. The line is 20px wide, so there are 10px above or below it the line that are “dead space”. The two correct points on the red handle are thus (10,10) and (30,10). Handles have a radius of 20px.

It is not possible to say red.arcEndX = blue.blackDotX, red.arcEndY = blue.blackDotY since the planes for the red and blue group are different. For instance, red’s (0,0) is always equal to blue’s (200,0). Think of each line as a chain that cannot be detached.

So, how do I calculate the red arc’s remaining point? It should attach seamlessly to the edge of the blue line, exactly where the center point of the black dot on the blue line is except translated in to red’s coordinate plane.

All of the measurements I may need are available, or can be calculated.

Handle.prototype.update = function() {

    /* if we are the red group, this.parent is our group and
       'prev' is the blue group. */

    var prev = this.parent.getPrev();  

    // somehow get the new (x,y) for point2 below:

    /* KineticJS SVG string.  this.origin and this.point1 never
       change. This (M)oves to 10,10, draws a (L)ine from
       this.origin.x, this.origin.y to this.point1.x, this.point1.y
       and (C)urves to this.point2.x, this.point2.y.  this.centerXY
       is the control point of that curve. */

    this.data = "M" + this.origin + "L" + this.point1 + "C" + this.point1 + "," + this.centerXY + "," + this.point2 + "L" + this.origin + "z";

    this.shape.setData(this.data);
}
  • 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-07T07:49:02+00:00Added an answer on June 7, 2026 at 7:49 am

    In case anybody stumbles upon this – what I have is correct except I failed to accomodate the origin translation. If you move everything to (0,0) for each plane, do your sin/cos then you’ll be OK

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

Sidebar

Related Questions

Please bear with me on this, this is quite difficult to explain and I
Please bear in mind that I'm totally new to Rails when answering this.My question
Please bear with me because my query is difficult to explain. Is it possible
I am guessing this is a noob question so please bear with me. I
Please bear with me for this novice question. I am calling a RESTful web
But please bear with me. I do not need help with ndns or JavaScript.
I'm new to Lua so please bear with this simple question :) I'm simply
This is my first question here so please bear with me - I apologise
Please bear with me on this question. I'm looking to create a relatively large
This is a long question so please bear with me. I start out with

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.