When you are watching a digitally-rendered battle onscreen in the latest blockbuster movie, you don’t always think about the “camera” moving about that scene. In the real-world, cameras have a field of view that dictates how much of the world about them they can see. Virtual cameras have a similar concept (called the viewing frustum) whereby they can only show so much of the digital scene. Everything else gets chopped off, so to speak. Because rendering a digital scene is a laborious task, computer scientists are very interested in making it go faster. Understandably, they only want to spend time drawing pixels that you’ll see in the final picture and forget about everything else (outside the field of view, or occluded (hidden) behind something else).
Our friends in the digital graphics world make heavy use of planes everyday, and being able to test for plane-plane intersection is extremely important.
In this post, I’ll try to break down what a plane is in understandable terms, how we can create one given a triangle, and how we would go about testing for the intersection between two of them. Continue reading “Representing plane intersections as a system of linear equations”
(Note: this article was originally written in and transcribed to WordPress, so forgive the equation alignment. Get the original). If you have a line and an ellipse, how can you tell where they intersect? This is a relatively simple problem that has worked-out examples all over the web if you Google for “line ellipse intersection”. However, what I’ve come to find is that nobody will actually give you the solution for an arbitrary line and an arbitrary ellipse. I’m here to do just that. Continue reading “An Analytic Solution for Ellipse and Line Intersection”
Imagine you have a point, a single little dot on a piece of paper. What’s the quickest way to go from that point to another point on the piece of paper? You (the reader) sigh and answer ”A straight line” because it’s completely obvious; even first graders know that. Now let’s imagine you have an open parking lot, with a human standing in it. What’s the quickest way for the human to get from one side of the parking lot to the other? The answer is again obvious to you, so you get a little annoyed and half-shout ”A straight-line again, duh!”. Okay, okay, enough toss-up questions. Now what if I gave you a car in the parking lot and asked you what was the quickest way for that car to get into a parking spot? Hmm, a little harder now.
You can’t say a straight line because what if the car isn’t facing directly towards the parking space? Cars don’t just slide horizontally and then turn in place, so planning for them seems to be a lot more difficult than for a human. But! We can make planning for a car just about as easy as for a human if we consider the car to be a special type of car we’ll call a Dubin’s Car. Interested in knowing how? Then read on!
Continue reading “A Comprehensive, Step-by-Step Tutorial to Computing Dubin’s Paths”
[Update: 10-21-2012: The geometry discussed in this post has been superseded by the discussion about path planning for Dubin’s Cars: https://gieseanw.wordpress.com/2012/10/21/a-comprehensive-step-by-step-tutorial-to-computing-dubins-paths/] I recently had a geometry problem I needed to solve involving finding tangent lines to two circles. If you’re like me, you don’t remember all the geometry you learned in school. And if you’re like me, you prefer searching the internet for answers versus turning to your books. I looked and looked online, but couldn’t really find a satisfying guide on finding the tangent points for two circles. Right now, even the Wikipedia page is a mess. How exactly does one “equate theta” and then “add x-y coordinates of a triangle” to a point? Perhaps in the future this will improve, but for now, here’s how I figured it out. I’m only going to run through finding one external tangent point. Figuring out the others as well as the tangent lines should become trivial afterwards.
Continue reading “Finding External Tangent Points for Two Circles”