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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:04:07+00:00 2026-05-18T06:04:07+00:00

i have a start point and a end point. I want to work out

  • 0

i have a start point and a end point. I want to work out the angle i have this formula that seems to work

double dx = end.X - start.X;
double dy = end.Y - start.Y;

double degrees = Math.Acos((-Math.Pow(dy, 2) + Math.Pow(dx, 2) + Math.Pow(dx, 2)) / (2 * Math.Pow(dx, 2)));
degrees = degrees * 180 / Math.PI;

Then i want to take the angle and extend the line’s length. i have this so far

end.Y = (start.Y + (len * Math.Sin(angle)));
end.X = (start.X + (len * Math.Cos(angle)));

now this does not give me the right value.

white is original line and red is the extending

white is original line and red is the extending

what am i doing wro

  • 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-05-18T06:04:08+00:00Added an answer on May 18, 2026 at 6:04 am

    This is what I meant in code:

    double dx = end.X - start.X;
    double dy = end.Y - start.Y;
    
    double dlen = Math.Sqrt(dx * dx + dy * dy);
    
    dx = dx / dlen;
    dy = dy / dlen;
    
    end.X = start.X + (dx * len);
    end.Y = start.Y + (dy * len);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have start date and end date. I need to find out the day
I have a start and end time in a timestamp format. I want to
I have a start point(X1,Y1) and end point(X2,Y2) I am drawing a line segment
I have a class function that I want to start up as a thread.
How I can draw bezier curve in canvas. I have only start point and
Is there a way for me to have eclipse start and point to a
I have start date and end date. I also have particular day i.e. wednesday.
I have a start of a webapp that I wrote without using the Object
I have a start date and end date field. Both has seperate ajax calender
I have function Start() that is fired on ready. When I click on .ExampleClick

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.