Clipping a ray's length

HelpPlease

New member
Joined
Sep 2, 2015
Messages
1
Hello!

I've drawn a little illustration to better explain my problem!

attachment.php


So I have 2 given points (P0, P1), the radius of the circle and I have the angle between the 2 points. I'd like to cast a ray from P0 to Px. Px would always be on the edge of the square inbetween the line given by P0 and P1.
My question how can I calculate Px point before casting the ray to make the raycast's length shorter to avoid uneccessary intersection checks.
Fyi the P1 point could be anywhere around the circle outside of the square.
 

Attachments

  • math.jpg
    math.jpg
    53.5 KB · Views: 1
  • math.jpg
    math.jpg
    57.6 KB · Views: 10
I've drawn a little illustration to better explain my problem!

[big picture]

So I have 2 given points (P0, P1), the radius of the circle and I have the angle between the 2 points.
As drawn, the points P0 and P1 appears to lie on the same line. Is this not always the case? If not, from what point are you measuring the angle between (the rays on which lie) the two points?

I'd like to cast a ray from P0 to Px. Px would always be on the edge of the square inbetween the line given by P0 and P1.
So are you here saying that P0 and P1 are on the same line, so I'm misunderstanding what you're saying in the previous quote? Or is this a new line, distinct from the lines implied previously?

My question how can I calculate Px point before casting the ray to make the raycast's length shorter to avoid uneccessary intersection checks.
What do you mean by "unnecessary intersection checks"?

Note: It may be helpful if you provided the full and exact text of the original exercise, exactly as it appears in the homework assignment. Thank you! :wink:
 
Top