Table of Contents

Our goal in this course is to understand the physics and therefore the mathematics that are involved in describing the motion of objects so that we can use them to model the motion of objects in the game world. Motion is a result of changing the position of an object over time, so let us first start with how we will describe the position of objects. First in 2Dimensions and then in 3Dimensions.
Points and Coordinate Systems in 2D
In mathematics there are several coordinate systems available to describe the location of a point in 2 or 3 dimensions. For our purposes, the rectangular or Cartesian coordinate system will be the most appropriate. In 2 dimensions, we most often use the x coordinate for the horizontal component of the location and y for the vertical component of the location. The image below shows a standard 2 dimensional Cartesian coordinate system.
In the plane, the x axis runs left to right with larger values to the right while the y axis runs up and down with larger values above. Each point in the plane can be refered to by its x and y coordinate pair $(x,y)$. This is called the ordered pair. The point with ordered pair $(0,0)$ is called the origin.
It is worth mentioning that the coordinates on the computer screen have the positive y direction pointing down and the origin in the upper left hand corner. One can work in the standard coordinate system and simplify convert to screen coordinates before outputting.
Distance in 2 Dimensions
Given two points in 2 dimensions the distance between them is defined as follows
(1)This formula can be easily derived from the theorem of Pythagoras.
First notice that the distance between the two points is just the length of the hypotenuse of a right triangle.
Side a has a length of $x_2x_1$
Side b has a length of $y_2y_1$
So from Pythagoras we have that $d=\sqrt{a^2+b^2}=\sqrt{(x_2x_1)^2+(y_2y_1)^2}$
Midpoint in 2 Dimensions
Given two points in 2 dimensions the midpoint is defined as follows
(2)Notice that the x coordinate of the midpoint is the average of the two x coordinates and likewise with the y coordinate
Lines in 2 Dimensions
Slope
One key feature of a line is the degree to which it inclines or declines. This feature is called it's slope. We define the slope of a line that passes through the points $(x_1,y_1)$ and $(x_2,y_2)$ as
(3)Exercise
Find the slope of the line that passes through the points (2,4) and (6,1).
The slope of a line is an indicator of how quickly the line rises or falls. For a line that rises from left to right the slope is positive. For a line that falls the slope is negative. For a vertical line the slope is undefined. For a horizontal line the slope is zero. The image below illustrates this fact.
Parallel Lines
Two lines that are parallel rise or fall at the same rate therefore their slopes are equal, assuming they exist. In other words, if $m_1=m_2$, then the two lines are parallel. If both slopes are undefined, then both lines are vertical and are therefore parallel.
Perpendicular Lines
In the case of perpendicular lines, as one line rises the other falls and the faster one rises the slower the other falls. Specifically, the slopes are related as opposite reciprocals, assuming they exist. That is to say, $m_1=\frac{1}{m_2}$. For the case of a vertical and a horizontal line, one line has a slope of 0, while the other line has undefined slope.
Point Slope Form
We can now use our definition of slope to create an equation of a line. Given a line with slope m that passes through the point $(x_1,y_1)$, every point $(x,y)$ on that line satisfies the equation
(4)Multiplying this equation on both sides by $xx_1$ yeilds the following
(5)This is the so called point slope form of the equation of a line.
Exercise
Find the point slope equation of the line that has slope $m=\frac{1}{2}$ and passes through the point $(2,3)$.
Example
Find the point slope equation on the line that passes through the points $(1,3)$ and $(2,6)$.
Slope Intercept Form
Now say we have a line with slope m and passing through the point $(0,b)$. This point lies on the yaxis since its x coordinate is zero. We call this point the yintercept of the line. If we plug this information into the pointslope equation we get
(6)This equation is the so called slope intercept form of the equation of a line. It is a specific case of the point slope form.
Standard Form
The one limitation of both of these forms is that they require the slope, but as we saw previously vertical lines have an undefined slope. In fact, vertical lines consist of all points with a common x value therefore they have an equation of the form $x=a$. This is a special case of the more general standard form of the equation of a line which is given by
(7)The equation of any line can be expressed in this form.
Example
Find the equation in standard form for the line with slopeinterpect form of $y=3x+4$
Example
Find the equation in standard form for the line with pointslope form of $y2=4(x+5)$
Example
Find the equation in standard form for the vertical line $x4=8$
Circles
Standard Form
A circle can be defined as the set of points that are all a fixed distance r, radius, from a common center, $(x_0,y_0)$.
We already know that in 2D distance is defined as $d=\sqrt{(x_2x_1)^2+(y_2y_1)^2}$. Since a cirlce is the set of points whose distance is r from the point $(x_0,y_0)$, the distance formula yields the formula
(8)This is the so called standard form of the equation of a circle in 2D.
Exercise
Find the center and radius of the circle $x^24x+y^2+10y=7$
Points and Coordinate Systems in 3D
In 3 dimensions, the Cartesian coordinate system has three perpendicular axes. The original x and y axes from the xyplane plus the zaxis that runs perpendicular to the xyplane. In the righthanded coordinate system the positive zaxis is pointing out of the screen and in the lefthanded coordinate system the positive zaxis is pointing into the screen.
To determine handedness you lay your hand flat on the xaxis with your fingers pointing in the positive x direction. Now curve your fingers in the direction of the positive yaxis. The direction your thumb is pointing will be the positive z direction.
In mathematics, it is somewhat standard to use a righthanded system with the positive z direction being up and the positive x direction being out.
Every point in 3 dimensional space can be uniquely defined by its ordered triple $(x,y,z)$.
Distance in 3 Dimensions
Our formula from 2 Dimensions can be extended the 3 dimensions by twice applying the theorem of Pythagorus.
(9)Notice that the z component is the same for the endpoints of side a. Therefore our 2 dimensional distance formula applies and
(10)Since only the z coordinate is different on the endpoints of side b, we know that
(11)Now applying the theorem of Pythagoras we get
(12)Exercise
Find the distance between (1,3,1) to (4,5,6)
Midpoint in 3 Dimensions
Given two points in 3 dimensions the midpoint is defined as follows
(13)Again each coordinate is the average of the corresponding original two coordinates.
Exercise
Find the midpoint of the points (8,20,6) and (9,10,1)
Spheres
The 3D analog of a circle is a sphere. using the definition of distance in 3D we get the standard form of the equation of a sphere with radius r and center $(x_0,y_0,z_0)$ as
(14)Exercises
 Draw a lefthanded 3D coordinate system with the positive xaxis pointing to the left.
 Find the distance and midpoint between the points (4, 11, –5) and (–3, 7, 2).
 Write the equation of a line passing through the points (6, 3) and (2, –5).
 Write the equation of a line passing through the point (4, –7) that is perpendicular to the line with equation $5x3y=9$.
 On a righthanded coordinate system with the zaxis pointing down, sketch a graph of the plane with equation $2x+3yz=4$.
 Write the equation of a circle with center (3, 8) and radius 7.
 Write the equation of a sphere where (5, 7, 3) and (–1, 5, 4) are endpoints of a diameter.
 A sphere has the equation $x^2+y^2+z^26y+5z=14$ . Find its center and radius.