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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:53:53+00:00 2026-06-15T23:53:53+00:00

I have a line from ( a , b ) to ( x ,

  • 0

I have a line from (a, b) to (x, y), and I would like to draw a line starting at (x, y), with length ℓ, that makes an angle of θ with the original line.

How do I compute the coordinates of the endpoint of this new line? See the diagram:

  • 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-15T23:53:54+00:00Added an answer on June 15, 2026 at 11:53 pm

    It’s nearly always simpler to use vector algebra for this kind of thing, rather than Cartesian coordinates. Let’s start by labelling the points:

    enter image description here

    Let R(θ) be the matrix that rotates by θ radians counter-clockwise:

    Then compute:

    v = B − A (the vector from A to B)

    v̂ = v / |v| (the unit vector in the direction of v)

    ŵ = R(−θ) v̂ (the unit vector in the direction of BC; your rotation is clockwise, so we need R(−θ) here, not R(θ))

    w = ℓ ŵ (the vector of length ℓ in the direction of BC)

    C = B + w

    This approach avoids the need to compute an arctangent, which would need some care (if done naïvely, it runs into trouble when B is vertically above or below A; but most languages have a function like atan2 for handling this case).

    In any sensible programming language with a vector library you should be able to write this as a one-liner, perhaps like this:

    C = B + (B - A).unit().rotate(-theta) * l
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that reads data from a file line-by-line. I would like
I would like to dynamically change the draw of a line from solid, dotted
I have a code at the moment that takes a line from a .txt
I have an app, that uses backup feature. This is line from my manifest:
I have some python module, that I import as: from mygraph.draw import pixel The
I am trying to have flash draw a line from the center of the
I have an image that has grid lines on it and would like to
I have a set of coordinates. I would like to take, for instance, the
I have a line that I draw in a window and I let the
I have taken the below line from one of the blog The only way

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.