Omnimaga

General Discussion => Other Discussions => Math and Science => Topic started by: Deep Toaster on January 30, 2012, 11:35:50 pm

Title: Linear algebra question: does a line pass through an object?
Post by: Deep Toaster on January 30, 2012, 11:35:50 pm
One game I'm working on involves some linear algebra, but unfortunately I don't know much linear algebra, so I decided to post it here. (This board's been pretty quiet, too D:)

Say I have an object—square or circle, whichever's easier—and a line segment. How do I find whether that line passes through the object, if the coordinates and size of both the line and the object are known?

Thanks in advance for any help!


EDIT: Thanks to jacobly for telling me the obvious solution: find the distance :P