Tag: Parametric Equations

  • Bézier Curves: How Four Points Create Beautiful Shapes

    How can four points create a smooth curve? Cubic Bézier curves appear in fonts, vector graphics, animation, and computer-aided design. Their geometry is controlled by just four points, yet they can bend, change concavity, and even cross themselves.

    1. Four control points and one curve

    Let P₀, P₁, P₂, and P₃ be points in the plane. For 0 ≤ t ≤ 1, define

    B(t)=1−t3P0+3t1−t2P1+3t21−tP2+t3P3

    Operations on points are interpreted coordinatewise. The curve begins at P₀ and ends at P₃. The broken line P₀P₁P₂P₃ is the control polygon; the curve need not pass through its middle vertices.

    A new numerical example

    Choose P₀=(0,0), P₁=(2,5), P₂=(6,5), P₃=(8,0). Substitution and simplification give

    x(t)=6t+6t2−4t3, y(t)=15t−15t2

    For example, at t=1/2, the point is B(1/2)=(4,15/4). The symmetry of the control points produces a symmetric arch.

    P0P1P2P3
    Figure 1. Our new example (blue) and its dashed control polygon. The middle control points guide the shape but are not on the curve.

    2. Why the curve stays in the convex hull

    The four scalar weights are (1−t)³, 3t(1−t)², 3t²(1−t), and t³. They are nonnegative for 0 ≤ t ≤ 1, and their sum is

    1−t3+3t1−t2+3t21−t+t3=(1−t+t)3=1

    Proof. By definition, a convex combination of points is a weighted sum with nonnegative weights totaling one. Every B(t) is such a combination of the four control points. Hence the entire curve lies in their convex hull—the smallest convex region containing them. This remains true even if the curve has a loop.

    3. Endpoint tangents

    Differentiate the defining polynomial and group the terms:

    B(t)′=31−t2(P1−P0)+6t1−t(P2−P1)+3t2(P3−P2)

    Consequently,

    B(0)′=3(P1−P0), B(1)′=3(P3−P2)

    Thus, whenever the respective endpoint derivative is nonzero, the tangent line at the start follows P₀P₁, and the tangent line at the end follows P₂P₃. In our example these tangent vectors are (6,15) and (6,−15). Notice that these vectors specify tangent directions, not necessarily the direction of the entire control polygon.

    4. De Casteljau’s algorithm: constructing the curve by interpolation

    For a fixed t, interpolate successively between neighboring control points:

    Qi=1−tPi+tPi+1 (i=0,1,2) Ri=1−tQi+tQi+1 (i=0,1,1) B(t)=1−tR0+tR1

    Why it works. Substitute the formulas for Q₀,Q₁,Q₂ into those for R₀,R₁, then into the last expression. Collecting the coefficients of P₀ through P₃ produces exactly the cubic Bézier formula in Section 1.

    At t=1/2, the first interpolation points are Q₀=(1,5/2), Q₁=(4,5), Q₂=(7,5/2); the next points are R₀=(5/2,15/4), R₁=(11/2,15/4). Their midpoint is (4,15/4), as expected.

    P0P1P2P3
    Figure 2. De Casteljau construction at t=1/2: orange first-stage interpolation, green second-stage interpolation, and the final black point on the curve.

    5. Can a cubic Bézier curve have a loop?

    Yes. Here is an exact construction, deliberately different from the textbook example. Consider the parametric cubic

    x(t)=(t−12)2, y(t)=(t−12)((t−12)2−116)

    At t=1/4 and t=3/4, both expressions yield the same point (1/16,0). Since the parameters are distinct, the curve crosses itself. Its Bézier control points, obtained by converting the cubic power coefficients to Bernstein form, are

    P0=(14,−332); P1=(−112,1396); P2=(−112,−1396); P3=(14,332)
    t=1/4 and 3/4
    Figure 3. An exact cubic loop. The two parameter values 1/4 and 3/4 give the same crossing point.

    6. Joining Bézier curves smoothly

    Suppose one segment ends at P₃ and the next begins at Q₀. Three commonly used continuity conditions are:

    C⁰: P₃=Q₀, so the pieces meet. G¹: their nonzero tangent vectors point in the same direction, so the tangent line has no corner. C¹: their tangent vectors are equal (for the chosen parameterization), so the first derivative is continuous.

    C1: P3=Q0, 3(P3−P2)=3(Q1−Q0)

    For a concrete S-shaped construction, take the first control polygon (0,0),(1,2),(2,2),(3,0) and the second (3,0),(4,−2),(5,−2),(6,0). Both derivatives at the join equal (3,−6), so the pieces meet with C¹ continuity. Equal tangents are stronger than merely collinear tangents.

    join
    Figure 4. Two cubic segments form an S-shaped path and meet with matching derivatives at (3,0).

    7. Curvature, inflection points, and a cubic limitation

    For a regular parametric curve B(t)=(x(t),y(t)), meaning B′(t)≠0, the unsigned curvature is

    κ(t)=|x′(t)y″(t)−y′(t)x″(t)|(x′2+y′2)32

    The numerator is the signed turning determinant. For cubic coordinate polynomials, x′ and y′ are quadratic while x″ and y″ are linear. Although the products appear cubic, their cubic terms cancel, leaving a polynomial of degree at most two. Therefore a nondegenerate regular planar cubic Bézier curve has at most two isolated interior inflection points, since changes in signed curvature can occur only at zeros of this quadratic.

    In our arch example, x′=6+12t−12t² and y′=15−30t, while x″=12−24t and y″=−30. Hence

    x′y″−y′x″=−360+360t−360t2=−360(1−t+t2)<0

    The signed curvature never changes sign: this particular arch has no inflection point.

    Discovery problems

    1. Midpoint identity. Express B(1/2) in terms of the four control points. What happens if P₀+P₃=P₁+P₂?
    2. Convex-hull challenge. Prove that every cubic Bézier curve stays in the convex hull of its control points. Does this still hold if the polygon is nonconvex?
    3. Exact self-intersection. For x(t)=(t−1/2)² and y(t)=(t−1/2)((t−1/2)²−1/16), find two distinct parameter values giving the same point and determine the crossing point.
    4. S-shaped design. Find two cubic Bézier curves from (0,0) to (3,0) and from (3,0) to (6,0) that meet with C¹ continuity and form an S-shaped path.

    Solutions (click to reveal)

    Solution 1: Midpoint identityB(12)=(P0+3P1+3P2+P3)8

    If P₀+P₃=P₁+P₂, this simplifies to B(1/2)=(P₀+P₃)/2, the midpoint of the endpoints.

    Solution 2: Convex hull

    All four Bernstein weights are nonnegative on [0,1] and add to one by the binomial theorem. Therefore B(t) is a convex combination of the control points. The convex hull exists regardless of whether the control polygon is convex, so the conclusion remains true.

    Solution 3: Exact crossing

    At t=1/4 and t=3/4, the squared term is 1/16 and the second factor of y(t) vanishes. Thus both parameter values yield (1/16,0). The two tangent directions are distinct, so this is a genuine transverse crossing.

    Solution 4: A smooth S

    Use P₀=(0,0), P₁=(1,2), P₂=(2,2), P₃=(3,0), followed by Q₀=(3,0), Q₁=(4,−2), Q₂=(5,−2), Q₃=(6,0). The join points agree and 3(P₃−P₂)=(3,−6)=3(Q₁−Q₀). Hence the joined curve is C¹, and the opposite signs of the upper and lower arches create the S shape.

    Bézier curves provide a way to construct smooth paths using a small number of control points. But can a continuous curve fill an entire square? Explore this surprising question in our article on space-filling curves .

    Parametric equations are useful far beyond computer graphics. Another interesting application appears in The Sliding Ladder: Does It Slide or Jump? , where calculus helps describe the motion of a ladder.

  • Projectile Motion in 3D: Adding Wind and Air Resistance

    The standard projectile-motion problem is familiar from calculus and physics: a projectile is launched with initial speed V at an angle θ above the horizontal from an initial height h. Gravity pulls it downward, and we ask two basic questions:

    • How high does the projectile go?
    • How far does it travel before hitting the ground?

    But real projectiles do not necessarily stay in a vertical plane. What happens if we add a horizontal wind blowing from the side? And what happens if we also include air resistance?

    The familiar two-dimensional parabola becomes a genuinely three-dimensional trajectory. With a simple model of air resistance, we can still obtain explicit formulas for almost everything.

    1. Setting Up the Coordinates

    Choose coordinates so that:

    • x is the original horizontal firing direction,
    • y is the vertical direction,
    • z is the sideways horizontal direction.

    The projectile is fired in the vertical xy-plane, so initially there is no velocity in the z-direction.

    The initial position is

    r (0) = ( 0,h,0 ).

    The initial velocity is

    v (0) = ( V⁢cos⁡θ , V⁢sin⁡θ ,0 ).

    2. Adding Wind

    Suppose a horizontal wind has speed W and makes an angle φ with the positive x-direction. Its velocity vector is

    w= ( W⁢cos⁡φ ,0, W⁢sin⁡φ ).

    The component W⁢cos⁡φ pushes along the original firing direction, while W⁢sin⁡φ produces sideways motion.

    3. Air Resistance Must Be Relative to the Air

    If there were no air resistance, a steady wind would have no effect on an ideal point projectile. Wind matters because the projectile interacts with the surrounding air.

    For a simple model, assume that air resistance is proportional to the projectile’s velocity relative to the moving air. If k is the drag constant per unit mass, the acceleration due to air resistance is

    −k ( v − w ).

    Gravity contributes

    ( 0,−g,0 ).

    Therefore the equation of motion is

    r″ = −gj −k ( r′ − w ).

    4. Three Differential Equations

    Writing the vector equation component by component gives

    x″ = −k ( x′ − W⁢cos⁡φ ) y″ = −g −ky′ z″ = −k ( z′ − W⁢sin⁡φ ).

    Although the trajectory is three-dimensional, something very convenient has happened: the three equations can be solved separately.

    5. Solving for the Velocity

    The velocity in the x-direction is

    vx (t) = W⁢cos⁡φ + ( V⁢cos⁡θ − W⁢cos⁡φ ) e−kt.

    The sideways velocity is

    vz (t) = W⁢sin⁡φ ( 1− e−kt ).

    The vertical velocity is

    vy (t) = ( V⁢sin⁡θ + gk ) e−kt − gk.

    Notice the long-term behavior. The horizontal velocity approaches the wind velocity, while the vertical velocity approaches

    −gk.

    In this linear-drag model, this is the terminal vertical velocity.

    6. The 3D Position

    Integrating the velocity components and using the initial position gives

    x (t) = W⁢cos⁡φt + V⁢cos⁡θ − W⁢cos⁡φ k ( 1− e−kt ). y (t) = h − gkt + V⁢sin⁡θ +gk k ( 1− e−kt ). z (t) = W⁢sin⁡φ [ t − 1− e−kt k ].

    These three equations describe the complete trajectory through space. Unlike the usual projectile trajectory, this curve is not a parabola.

    7. When Does the Projectile Reach Its Maximum Height?

    At maximum height the vertical velocity is zero:

    vy ( tmax ) =0.

    Therefore

    ( V⁢sin⁡θ +gk ) e −ktmax = gk.

    Solving for time gives

    tmax = 1k ln⁡ ( 1 + kV⁢sin⁡θ g ).

    8. Maximum Height

    Substituting this time into the vertical position formula and simplifying gives

    Hmax = h + V⁢sin⁡θ k − gk2 ln⁡ ( 1 + kV⁢sin⁡θ g ).

    An interesting consequence is that the horizontal wind does not appear in this formula. In this model, horizontal wind changes where the projectile lands, but it does not change its maximum height.

    9. When Does It Hit the Ground?

    Let T denote the time at which the projectile hits the ground. We find T by setting

    y (T) =0.

    Thus T satisfies

    h − gkT + V⁢sin⁡θ + gk k ( 1− e−kT ) =0.

    Here we encounter an important difference from the standard projectile problem. Without air resistance, finding the flight time requires solving a quadratic equation. With linear air resistance, the unknown T appears both outside and inside an exponential.

    In practice, the positive solution can be found numerically using a calculator, computer, graphing program, or Newton’s method.

    10. Where Does It Land?

    Once the flight time T has been found, the landing point is

    ( x(T) , 0 , z(T) ).

    The downrange distance in the original firing direction is x(T) , while the sideways displacement is z(T) .

    The total horizontal distance between the launch point and landing point is

    R= x(T) 2 + z(T) 2 .

    So in three dimensions, the question “How far does the projectile go?” has more than one possible answer. We can ask for its downrange distance, its sideways drift, or its total horizontal displacement.

    11. How Far Sideways Does the Wind Push It?

    The sideways displacement at landing is

    z (T) = W⁢sin⁡φ [ T − 1− e−kT k ].

    This is zero when the wind blows exactly along the original firing direction. It becomes nonzero when the wind has a crosswind component.

    12. A Consistency Check: Remove Air Resistance

    A good mathematical model should reproduce the familiar result when the new effect is removed. Let the drag coefficient k approach zero. A key limit is

    lim k→0 1− e−kt k =t.

    As air resistance disappears, the vertical motion approaches

    y (t) = h + V⁢sin⁡θt − 12 gt2,

    which is exactly the standard projectile-motion formula.

    The maximum-height formula also approaches

    Hmax → h + V2 sin⁡θ 2 2g .

    Again, this is precisely the familiar result.

    13. From a Parabola to a Space Curve

    The ordinary projectile problem is two-dimensional. Its trajectory is a parabola contained in a vertical plane.

    Adding a crosswind and air resistance changes the geometry completely. The projectile now moves simultaneously forward, vertically, and sideways. Its position is described parametrically by

    r (t) = ( x(t) , y(t) , z(t) ).

    This is a natural example of why parametric vector equations are useful: there is no need to force a three-dimensional trajectory into a single equation involving x, y, and z.

    14. What Makes This Problem Interesting?

    The standard projectile problem is often presented as an application of quadratic functions. But a relatively small change in the physical assumptions leads to much richer mathematics.

    The three-dimensional model combines:

    • vectors and parametric curves,
    • differential equations,
    • exponential functions,
    • optimization,
    • numerical root finding,
    • limits,
    • and mathematical modeling.

    Most importantly, the model separates two questions that look similar but are physically different. Gravity and vertical drag determine when the projectile hits the ground. The wind and horizontal drag then determine where it lands.

    That is the real advantage of moving from the familiar two-dimensional projectile problem to a three-dimensional model: instead of asking only “How far?”, we can ask the more interesting question: Where will it land?

    Worked Example: Where Does the Projectile Land?

    Let us use the formulas above with actual numbers. Suppose a projectile is launched from a height of 10 meters with an initial speed of 40 m/s at an angle of 45° above the horizontal.

    A horizontal wind blows at 10 m/s at an angle of 60° from the original firing direction. Assume a linear drag constant k = 0.10 s−1 and take g = 9.81 m/s2.

    Thus our data are

    h=10 m,   V=40 m/s,   θ=45°, W=10 m/s,   φ=60°,   k=0.10 s −1.

    Step 1: When Does It Reach Maximum Height?

    The time at which the projectile reaches its maximum height is

    tmax = 1k ln⁡ ( 1 + kV ⁢ sin⁡θ g ).

    Substituting the numerical values gives

    tmax = 10.10 ln⁡ ( 1 + ( 0.10 ) ( 40 ) sin⁡ 45° 9.81 ).

    Therefore,

    tmax ≈ 2.533 s.

    The projectile reaches its highest point about 2.53 seconds after launch.

    Step 2: What Is the Maximum Height?

    The maximum height is

    Hmax = h + V ⁢ sin⁡θ k − g k2 ln⁡ ( 1 + kV ⁢ sin⁡θ g ).

    Substitution gives

    Hmax = 10 + 40 sin⁡ 45° 0.10 − 9.81 0.102 ln⁡ ( 1 + ( 0.10 ) ( 40 ) sin⁡ 45° 9.81 ).

    Thus

    Hmax ≈ 44.32 m.

    The projectile rises to approximately 44.32 meters above the ground.

    Step 3: When Does It Hit the Ground?

    The projectile hits the ground when y ( T ) =0 . For our values, this means solving

    10 − 9.810.10T + 40 sin⁡ 45° + 9.810.10 0.10 ( 1 − e −0.10T ) =0.

    Unlike the standard projectile problem, this is not a quadratic equation. The unknown T appears both by itself and in an exponential. Solving the equation numerically gives

    T ≈ 5.698 s.

    So the projectile is in the air for approximately 5.70 seconds.

    Step 4: How Far Downrange Does It Travel?

    The horizontal x-coordinate at landing is

    x ( T ) = W ⁢ cos⁡φ ⁢T + V ⁢ cos⁡θ − W ⁢ cos⁡φ k ( 1 − e −kT ).

    Substituting T≈5.698 gives

    x ( T ) ≈ 129.62 m.

    Thus the projectile travels approximately 129.62 meters downrange.

    Step 5: How Far Sideways Does the Wind Push It?

    The sideways coordinate at landing is

    z ( T ) = W ⁢ sin⁡φ [ T − 1 − e −kT k ].

    Substituting the numerical values gives

    z ( T ) = 10 sin⁡ 60° [ 5.698 − 1 − e − ( 0.10 ) ( 5.698 ) 0.10 ].

    Therefore,

    z ( T ) ≈ 11.73 m.

    The wind has pushed the projectile approximately 11.73 meters sideways from the original vertical firing plane.

    Step 6: Where Does It Land?

    We now know both horizontal coordinates. Therefore the landing point is approximately

    P = ( 129.62 , 0 , 11.73 ) m.

    In other words, the projectile lands approximately 129.62 meters downrange and 11.73 meters sideways from the original vertical firing plane.

    Step 7: Total Horizontal Displacement

    The straight-line horizontal distance from the point directly below the launch position to the landing point is

    R = x ( T ) 2 + z ( T ) 2 .

    Therefore,

    R = 129.622 + 11.732 ≈ 130.15 m.

    The Answer

    For this example, the projectile reaches a maximum height of approximately 44.32 m and stays in the air for approximately 5.70 s.

    It lands approximately 129.62 m downrange and 11.73 m sideways from the original vertical firing plane. Thus its landing point is

    ( 129.62 , 0 , 11.73 ) m.

    The total horizontal displacement from the point directly below the launch position is approximately 130.15 m. The sideways displacement shows exactly how the wind changes the familiar two-dimensional projectile problem into a three-dimensional one.


    For another example of how calculus can reveal something unexpected in a real-world motion problem, see Sliding Ladder: Is It Better to Slide or Jump?.

    Projectile motion and planetary motion are both governed by Newton’s laws. Near Earth’s surface, gravity is approximately constant, while planetary orbits require the inverse-square law of gravitation. Explore this connection in Kepler’s Laws: How Calculus Explains Planetary Motion .