Reflections
The objective of this section is to cover geometric constructions using points and vectors. In particular this section focuses on reflecting shapes about other shapes.
Point about Point
Provided with a point p
and another point o
, determine the location of the point of reflection q
from p
about o
.
""" Inputs
"""
p = Point3d( px, py, pz )
o = Point3d( ox, oy, oz )
Solution
We can consider the reflection in the sense of translating point p
against the direction to o
by the same length. This is also equivalent to moving from p
, twice the distance to o
along the same direction. Therefore, first we construct the vector u = p - o
and the perform the translation q = p - u
, which can be expanded to q = p + ( p - o )
or simply q = 2 * p - o
.
""" Outputs
"""
u = p - o
q = p + u
''' or '''
q = 2 * p - o
Point about Line
Provided a line ( o, u )
, defined by its origin point o
and the unit direction u
, and a second point p
, determine the location of the point of reflection from q
about the line.
""" Inputs
"""
o = Point3d( ox, oy, oz )
u = Vector3d( ux, uy, uz )
p = Point3d( px, py, pz )
Solution
The reflection can be performed by first projecting the point p
onto the line by computing the point x = o + u * ( p - o ) * u
and the translating it by the same projected distance and direction q = x + ( x - p )
.
""" Outputs
"""
x = o + u * ( p - o ) * u
q = x + ( x - p )
''' or '''
q = 2 * x - p
Point about Plane
Provided with a plane ( o, n )
defined by its origin point o
and the unit normal vector n
, and another point p
, determine the location of the point of reflection from p
about the plane.
""" Inputs
"""
o = Point3d( ox, oy, oz )
n = Vector3d( nx, ny, nz )
p = Point3d( px, py, pz )
Solution
The operation can be performed by first projecting the point p
onto the plane by computing point x = p - n * ( p - o ) * n
, and then translating it about the same direction and distance to q = x + ( x - p )
.
""" Outputs
"""
x = p - n * ( p - o ) * n
q = x + ( x - p )
''' or '''
q = 2 * x - p
Point about Circle
Provided with a circle ( o, r )
, defined by its center point o
and radius r
, and a second point on the circle, p
, determine the location of the point q
diametrically opposite from p
.
""" Inputs
"""
r = 2.0
o = Point3d( ox, oy, oz )
p = Point3d( px, py, pz )
Solution
This problem has exactly the same solution as reflecting a point about another point. Since the point p
is already on the circle, its reflection about the center should also land on the circle.
""" Outputs
"""
u = p - o
q = p + u
''' or '''
q = 2 * p - o
The Death Star
Provided with a point s
, another point r
and a third point t
, determine two basis vectors u
and v
of a plane ( r, u, v )
, such that a ray emanating from the source point s
, reaching a reflector disk on plane at r
, will redirect the ray such that it will hit the target point t
.
""" Inputs
"""
r = Point3d( rx, ry, rz )
s = Point3d( sx, sy, sz )
t = Point3d( tx, ty, tz )
Solution
The problem can be approach by assuming that the angle of incidence on flat reflective surface equals the angle of reflection. Therefore, the normal direction n
of the reflector plane must be the bisector of the angle of the triangle ( r, s, t )
at point r
. Furthermore, to compute the basis vectors of a plane defined by its origin and normal direction requires using the unary cross product concept.
""" Outputs
"""
u = s - r; u.Unitize( )
v = t - r; v.Unitize( )
n = u + v; n.Unitize( ) #-- Bisector == Normal
u = Vector3d_UnaryCrossProduct( n )
v = Vector3d.CrossProduct( n, u )