Author Topic: Linear algebra question: does a line pass through an object?  (Read 2559 times)

0 Members and 1 Guest are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Linear algebra question: does a line pass through an object?
« 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
« Last Edit: January 30, 2012, 11:39:13 pm by Deep Thought »