Previous | Next --- Slide 8 of 26
Back to Lecture Thumbnails
HelloWorld

For checking if the point is between the endpoints, we can also just see if the point is within the bounding box described by the endpoints.

keenan

@HelloWorld Yes, this is a good point. It's not clear to me which one is actually cheaper/easier. Maybe someone wants to write out some pseudocode comparing the two? :-)

mdsavage

Without writing pseudocode, it seems like the bounding box check ought to be faster since the computation of t will always require at least one division operation (e.g. to divide the a-p distance by the a-b distance), which would use far more cycles than the four bounds checks. Perhaps there are cases in which we need t for further computations that may make it worth computing?