19
INTERPOLATION & APPROXIMATION

INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Embed Size (px)

Citation preview

Page 1: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

INTERPOLATION & APPROXIMATION

Page 2: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Curve algorithm• General curve shape may be generated

using method of– Interpolation (also known as curve fitting)

• Curve will pass through control points

– Approximation• Curve will pass near control points may interpolate

the start and end points.

Page 3: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Curve algorithm

interpolation approximation

Page 4: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Interpolation vs approximation

x

f(x)

x

f(x)

x

f(x)

x

f(x)

curve must pass through control points

curve is influenced by control points

Page 5: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Parametric equation of line = Vector equation of a line

• P(t) = a + ut

a

u

P

u 2u

P

tu

P

a

u

b

•P(t) = a + (b-a)t

•u = (b-a)

t=0t=1

0<=t<=1

P

t=0.25

P

t=0.5

P

t=0.75

X(t) = ax + (bx – ax)tY(t) = ay + (by – ay)tZ(t) = az + (bz – az )t

Page 6: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Linear interpolation

• P(t) = A(1-t) + Bt• In matrix form• P(t) = = A B . .

A

B

t=0

t=1

X(t)Y(t)Z(t)

-1 11 0

t1

in animation : - path , morphing

Page 7: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Interpolation Curves

• Curve is constrained to pass through all control points

• Given points P0, P1, ... Pn, find lowest degree polynomial which passes through the points

x(t) = an-1tn-1 + .... + a2t2 + a1t + a0

y(t) = bn-1tn-1 + .... + b2t2 + b1t + b0

Page 8: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Interpolating curve : piecewise linear

• Curve defined by multiple segments (linear)

• Segments joints known as KNOTS

• Requires too many data points for most shape

• Representation not flexible enough to editing

Page 9: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Interpolating curve : piecewise polynomial

• Segments defined by polynomial functions

• Segments join at KNOTS

• Most common polynomial used is cubic (3rd order)

• Segment shape controlled by two or more adjacent control points.

Page 10: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Knot points

• Location where segments join referred to as knots

• Knots may or may not coincide with control points in interpolating curves.

Page 11: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Curve continuity

• Concern is continuity at knots.

• Continuity conditions– Point continuity (no slope or curvature

restriction / no gap)– Tangent continuity (same slope at knot)– Curvature continuity ( same slope and

curvature at knot)

Page 12: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

• Continuity - Cn

– C0 continuity – continuity of endpoint only or continuity of position.

– C1 continuity is tangent continuity or first derivative of position

– C2 continuity is curvature continuity or second derivative of position.

Curve continuity

Page 13: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Curve continuity

C0 C1

C2

Page 14: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Interpolation curves

• Typically possess curvature continuity

• Shape defined by– Endpoint and control point location– Tangent vectors at knots– Curvature at knots

Page 15: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Interpolation vs. Approximation Curves

• Interpolation Curve – over constrained → lots of (undesirable?) oscillations

• Approximation Curve – more reasonable?

Page 16: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Approximation techniques

• Developed to permit greater design flexibility in the generation of free form curves

• Common methods in modern CAD systems, bezier, b-spline, NURBS

• Employ control points (set of vertices that approximate the curve)

Page 17: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

• Curves do not pass directly through points (except start and end)

• Intermediate points affect shape as if exerting a “pull” on the curve.

• Allow user to set shape by “pulling” out curve using control point location.

Approximation techniques

Page 18: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Example – bezier curve

Page 19: INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve

Cubic Bézier Curve• 4 control points• Curve passes through first & last control point

• Curve is tangent at P1 to (P1-P2) and at P4 to (P4-P3)