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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:38:09+00:00 2026-06-11T02:38:09+00:00

Given an angle and having drawn a line from the center of a bounding

  • 0

Given an angle and having drawn a line from the center of a bounding box, how can we compute the coordinates at which the line will intersect the bounding box?

Please have a look at the following diagram:
enter image description here

As you can see, for example, at angle 0 the line intersects point (0.5, 1)

How can we turn this problem into a computable formula that accepts an angle and returns x and y coordinates?

  • 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-11T02:38:10+00:00Added an answer on June 11, 2026 at 2:38 am

    You can solve by using trigonometry and handling each 45 degree section separately:

    Given:

    • xmin, xmax (limits of x axis for boxed region)
    • ymin, ymax (limits of y axis for boxed region)
    • a (angle)
    • output coordinates of x and y
    • width = (xmax – xmin)
    • height = (ymax – ymin):

    Angle range; x; y

    • (0<= a <= 45); x = xmin + (tan(a)*(width/2) + width/2; y = ymax
    • (45<= a <= 90); x = xmax; y = ymin + (tan(90-a)*height/2) + height/2
    • (90<= a <= 135); x = xmax;y = ymin + (tan(a-90)*height/2) + height/2
    • (135<= a <= 180); x = xmin + (tan(180-a)*width/2)+width/2; y = ymin
    • (180<= a <= 225); x = xmin – (tan(a-180)*width/2)+width/2; y = ymin
    • (225<= a <= 270); x = xmin; y = ymin -(tan(270-a)*height/2)+height/2
    • (270<= a <= 315); x = xmin; y = ymin + (tan(a-270)*height/2)+height/2
    • (315<= a <= 360); x = xmin -(tan(360-a)*width/2)+width/2; y = ymax
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given a cartesian position, how can you map the angle from the origin into
Given a center point, width, height and angle forming an OBB, how can I
How can I find the Angle of a line between two points in actionscript
In transformPosition method we can apply angle for specific sprite as given below; [sprite
Assuming the upper left corner is (0,0) and I'm given an angle of 30
Given a square (described by x, y, width, height) and an angle (in radians)
This is similar to my last question; but from a different angle. See if
Given a circle with a known center point and two points on the circle
i need to draw a polygon of n sides given 2 points (the center
I need to rotate by a given angle a UIImageView created by Interface builder

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.