Jump to content

[1.0] Find out whether a marker is within a certain line?


robhol

Recommended Posts

Within a certain line? Do you mean "on" the line? If so, you'd have to calculate the angle of that line and calculate the angle of line "starting at one of the ends of the line and ending at the place of marker" if the angle is the same it means the marker is on the line. Also, remember to check if the length between marker and "one of the ends of the line" is shorter or equal to the length of the line.

Here's what I mean:

mathcb0.png

if ( lineA >= lineB ) and ( angleA == angleB ) then 
    -- the marker is on the line 
else 
    -- it's not on the line 
end 

Link to comment

I think he means between two lines. So for instance:

Line 1 starts on 0,0, is 50 units long, and has an angle of 23 degrees.

Line 2 starts on the same position, also 50 units long, and has an angle of 50 degrees.

The marker is somewhere in between.

Is there a way to see if the marker is in between those two lines? (just an example of what I think he means)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...