Curves in Computer graphics – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Sun, 14 Aug 2022 09:24:01 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://programmerbay.com/wp-content/uploads/2019/09/cropped-without-transparent-32x32.jpg Curves in Computer graphics – Programmerbay https://programmerbay.com 32 32 Types Of Curves in Computer Graphics https://programmerbay.com/c-graphics-curve-and-its-types/ https://programmerbay.com/c-graphics-curve-and-its-types/#respond Wed, 10 Aug 2022 17:57:28 +0000 https://programmerbay.com/?p=5144 A curve is a collection of indefinite points where each and every point has two neighbors, except start and endpoints (as they have one).

There are three types of curves:

  1. Implicit Curve

  2. Explicit Curve

  3. Parametric Curve

Types of Curves in Computer Graphics

Implicit Curve

It can be expressed as the collection of points which are defined by an implicit equation to check whether a point on the curve or not.
The given function is referred to as implicit function
f(x,y)=0
In this, this function would give multiple values of x for a single value of y. It is also known as multivalued function

Implicit : When a soloution can not be expressed  for x in form of y 

Explicit Curve

It can be expressed as the collection of points which are plotted on using a function y = f(x).

y=f(x)

In this, the given function would give a single value of x for a single value of y. It is also known as a Single valued function

Parametric Curve

If a curve whose points are plotted using a parametric function is known as the parametric curve.

f = g1(t), g2(t),  it can be represented as (x,y)

where the value of t is in between 0 and 1
t =[0,1]


What is B-Spline Curve with equation

In B-spline curve, Local control is imposed on a curve, means a B-spline curve usually divide into segments and changing control points respective to a particular segment would only change that shape of that region only. In Bezier curve, controls are global, changing a control will lead to change the entire shape of a curve.

Each and every segment uses a unique basis function

S(t) = ∑ni=0   SiNi, p(u)         0<=t<=n-p+2

p are the points that control a segment

S is number of control points

Ni, p(t)  = (u-ki)Ni,p-1(u)/ki+p-1-k (u-ki+p)Ni+1,p-1(u)/ki+p-ki +1

k are the number of knot points

ki where i lies  ( 0<= i <= n+p )

ki = 0,  if i< p

ki = i-p +1 ,  if p<= i<= n

ki = n-p+2,  if i>n

Ni, p(u)     = 1  if  ki <= u <= ki+1

Properties of  B-spline curve

1) B-spline curve consists of n+1 control points and p order of the curve.

2) It has local control over curve that controls segments separately.

3) A degree of polynomial depends on the order of the curve which is p-1.

4) B-spline consists of n-p+2 segments.

5) Number of control points can be changed without affecting the degree of a polynomial


What is Bezier curve with equation

Bezier curve was founded by a French scientist named Pierre Bézier. This Curve is drawn by using Control points. In this, Approximate tangents act as control points which are used to generate the desired Bezier. It is a parametric curve which follows bernstein polynomial as the basis function.

B(t) =  ∑ki=0  PkBkn(t)       , Where t lies between 0 and 1, 0<=t<=1

P represents number of control points

Bk, n(t)=  nCk    uk (1-t)n-k

Tangent: It is a straight line that exactly touches curve.

Types of Bezier Curve

1)  Simple Bezier Curve : The simple line connecting endpoint.

simple bezier curve

2) Quadric Bezier Curve: Quadric curve using 3 control points

quadratic bezier curve

3) Cubic Bezier Curve: Cubic curve using 4 control points

cubic bezier curve

Bezier curve Properties:

1) A Bezier curve always depends on the number of control points that require to draw it.

2) Curve can be drawn using endpoints only.

3) The polynomial equation also depends on the number of control points Suppose, n is a control point then the degree of the polynomial equation will be n-1.

4) Curve passes through initial and terminating control points.

5) Closed Bezier curve can be generated by making the first and last control points the same.

]]>
https://programmerbay.com/c-graphics-curve-and-its-types/feed/ 0