Finding Centroid Coordinates Under Degree 3 Bezier Curve

  • Thread starter jjj888
  • Start date
  • Tags
    Centroid
In summary: Therefore you can see how the parameters change when you do the same integral (i.e. you can use the substitution to see how the integral changes).This will give you a way to see how the equivalent integrals work.In summary, the conversation discusses finding the centroid coordinates under a degree 3 bezier curve. Various formulas and methods are suggested, including treating it as a center of mass problem, using a density function, and breaking up the plot into sections. The final solution is found using a formula involving integrals and substituting values for the parameters.
  • #1
jjj888
23
0
Does anyone have an easy formula for finding the centroid coordinates under a degree 3 bezier curve?

The whole parametric two variable thing isn't working with the formulas I know of.

Thanks
 
Mathematics news on Phys.org
  • #2
See http://www.infogoaround.org/JBook/Inertia.html (inder "Green's Theorem").

You wouldn't really expect the formula to be "easy", since you can reparametrize a Bezier curve in arbitrary ways without changing its shape.

To do it numerically, interpolate points P1, P2, P3, etc along the curve and chop the area into triangles OP1P2, OP2P3, etc where O is the origin (or any other "fixed" point in the plane).
 
  • #3
So,

Here's my parametric equations:

x = 3t
y = 5t^3-9t^2+6t

I get this when using that formula from the green's therom page:


X =∫(5x^3-9x^2+6x)^2*3dx = -2.657

Y = ∫(3y)^2(15y^2−18y+6)dy=2.25

int from 0 to 1.

when I load the points in CAD I get:

x = 1.8
y = 0.7086

Which makes sense when you look at it.
I ran the equations through few other centroid formulas and I don't really get anything consitent. I can find the area pretty easy with parametic integration, but this centroid is giving me trouble.

Please Help,
Thanks
 
  • #4
Hey jjj888 and welcome to the forums.

It's going to be easier if you treat this as a centre of mass problem and assume that all points of the curve contribute evenly to the 'mass' of the function.

We know that to find the centroid you sum all of the values up and divide by the number of values in a discrete case. For the continuous case, we use the density function, but we assume that that the density is the same for all points.

So you have functions for x and y and given that the density is constant, how would you calculate the centroid from this?
 
  • #5
If the density is constant you would use 1. But I read this somewhere else, and they said to just integrate my original functions normally, which also doesn't give me:
x=1.5
y=-1.25
 
  • #6
jjj888 said:
If the density is constant you would use 1. But I read this somewhere else, and they said to just integrate my original functions normally, which also doesn't give me:
x=1.5
y=-1.25

Assume your parameterization is [0,1] region.

Integrating 3tdt (since x = 3t) over [0,1] gives 3/2 = 1.5
Integrating 5t^3-9t^2+6t (since y = 5t^3-9t^2+6t) over [0,1] gives 1.25

These look like the answers above but the y value has the opposite sign.
 
  • #7
Wouldn't the y co-ordinate of the centroid be ∫y.ds/∫ds, where ds2 = dx2+dy2? (And likewise x co-ord.) If so, ds will be dt*√(a quartic in t)
 
  • #8
But,

As I said above, when I plot the curve out in CAD the centroid cordinates are:

x = 1.8
y = 0.7086

But I can't seem to get this answer. I'm fairly certain this answer is correct, it makes sense when you look at it. Very confusing at this point.
 
  • #9
One suggestion I have is to rederive the centroid using delta statements and take the limit to get the calculus definition, just to clarify what the expression should be.
 
  • #10
you're going to have to break that down for me a bit.
 
  • #11
Well the centroid is the average of all data points and it is co-ordinate wise.

So let's say we do it with a spacing of deltax (dx is the limit as it goes to zero).

The continuous formulation is basically the analog of the expectation formula but there is slight difference: the difference is that the density refers to the number of points that take a particular value.

So to do this you need to break up the plots of all components (i.e. x and y) into sections that are increasing: you can use the first derivative to do this.

Then what you do is basically create a kind of 'histogram' of the density of the number of points in a bin with respect to all bins (each bin has the same height when you plot component against the parameter).

The bin size takes a limit argument to zero and you get a density function from all sections for each component. You then apply the expectation formula to that distribution you calculated where if f(x) gives the probability at x you calculate E[X].

This will give you the centroid.

If you want an approximation just a small enough bin size and this will give you a way to get a discrete distribution for each bin and then use the x value as the 'centre' of the bin and use E[X] for X being a discrete random variable.
 
  • #12
jjj888 said:
As I said above, when I plot the curve out in CAD the centroid cordinates are:
x = 1.8
y = 0.7086
But I can't seem to get this answer. I'm fairly certain this answer is correct, it makes sense when you look at it. Very confusing at this point.
OK, I misunderstood the problem. I thought you wanted the centroid of the curve. In fact, you want the centroid of the lamina bounded by that curve, the x-axis, the y-axis, and the line x = 3, yes?
xc = ∫Ax.dx.dy/∫Adx.dy
Adx.dy = ∫t=01y(t).dx(t) = ∫(5t3-9t2+6t).3dt = 3[5t4/4-3t3+3t2]t=01 = 3(5/4-3+3) = 15/4
Ax.dx.dy = ∫3t(5t3-9t2+6t).3dt = 9∫(5t4-9t3+6t2).dt = 9[t5-9t4/4+2t3] = 9(1-9/4+2) = 27/4
xc = 9/5, agreeing with CAD.
 
  • #13
Thanks,

I acctually did find the answer.

x = 3t
y = 5t^3-9t^2+6t

I got the answer using the formula below. This is the first formula I encountered when I started.

x=1/A∫abxf(x)dx
y=1/A∫ab(1/2)[f(x)]2dx

My error was with the area. I used the area under the curve of the parametric equations, but I should have used the area under f(x):

x=(1/1.25)∫01[3t(5t3-9t2+6t)]dt=1.8
y=(1/1.25)∫01(1/2)[(5t3-9t2+6t)2]dt=0.70857

Following the proof of the forluma it makes sence, but I'm still confused as to why it works with the parametric equations.
 
  • #14
Hey jjj888.

You are integrating with respect to each parameter and substituting those values in the integral and since they equivalent, they are giving the same answer. (i.e. y = f(x) = g(t) and x = other function of t).

What you can do if you want to formalize it is to do an integral substitution and see how the limits change from (a,b) to (0,1).
 
  • #15
Ok so I'm adding on to this a bit.

I have:
x=0.9t3+5.1t2
y=-1.8t3-3.9t2+13.2t

using :
x=1/A∫abxf(x)dx
y=1/A∫ab(1/2)[f(x)]2dx

for centroid I get:
x=2.656
y=2.957

in cad Iget:
x=3.371
y=3.2872
which makes more sense

similarly I have:
x=-0.35t3-0.9t2+8.25t+6
y=4.4t3-6.6t2+7.5

for centroid I get:
x=9.496
y=3.246

in cad I get:
x=9.2657
y=3.289

Wich is close but still not the same. Is there some issue with my integration bounds, or is it an issue with the area divisor? I've been playing with this for about a week and now I'm stuck.

Also, the two curves above link together, is there a way I can find the centroid for these two curves, (cad shows:x=6.6096,y=3.2882) how would I set it up if I had more?

Thanks
 
  • #16
Did you see haruspex's working out above?
 
  • #17
Try writing out your derivation of the first x co-ord in detail (the 2.656) and I'll try to find the error. I get 125.59/37.26 = 3.37.
 
  • #18
I did, but i wasn't too familiar with the notation. I'll take a look again.
 
  • #19
I'm having trouble understanding how
xc = ∫Ax.dx.dy/∫Adx.dy is equal to x=1/A∫abxf(x)dx?

Anyway here's my x derivation using x=1/A∫abxf(x)dx:

x = 1/4.85∫01((0.9t3+5.1t2)(-1.8t3-3.9t2+13.2t)) = 2.656

I set it up the same way as the previous problem. I would think this is a fairly common problem, that is finding parametric equations to fit curves to things to calculate areas, centers, etc. It's strange I can't find more information about it out there. Obviously it's easily done with computers, but I just like to know how it works.

Thanks
 
  • #20
jjj888 said:
I'm having trouble understanding how
xc = ∫Ax.dx.dy/∫Adx.dy is equal to x=1/A∫abxf(x)dx?
Ax.dx.dy = ∫A.dy.x.dx = ∫xy.dy.x.dx = ∫xy.x.dx
Anyway here's my x derivation using x=1/A∫abxf(x)dx:
x=0.9t3+5.1t2
y=-1.8t3-3.9t2+13.2t

x = 1/4.85∫01((0.9t3+5.1t2)(-1.8t3-3.9t2+13.2t)) = 2.656
What happened to dx? dx is (dx/dt)dt, not dt.
Let me illustrate just in calculating A:
A = ∫A.dy.dx = ∫xy.dy.dx = ∫xy.dx = ∫t y.(dx/tx).dt = ∫t (-1.8t3-3.9t2+13.2t).(2.7t2+10.2t).dt = 37.26
 
  • #21
Thanks, but before I try to decifer this I'm still having notation issues, what do these symbols mean:
A, ∫x, ∫y, ∫t.

Are they definites of that variable, or is there something else. Is there a different way to write it?

Thanks
 
  • #22
jjj888 said:
I'm still having notation issues, what do these symbols mean:
A, ∫x, ∫y, ∫t.
A means the integral over the region A. This is a reasonably standard notation and has the merit of being meaningful independently of the choice of variable. In that respect, it's analogous to a path integral in complex analysis.
The other three I used merely to emphasise what the variable of integration was in each case. It's redundant here really because it should be clear from the .dx or whatever.
 
  • #23
So,

if dx = (dx/dt)dt then,

x=1/A∫txf(x)(dx/dt)dt
y=1/A∫t(1/2)[f(x)2](dx/dt)dt

xc = ∫t[(0.9t3+5.1t2)(-1.8t3-3.9t2+13.2t)(2.7t2+10.2t)]dt/∫t[(-1.8t3-3.9t2+13.2t)(2.7t2+10.2t)]dt = (125.59/37.26) = 3.37

yc = ∫t(1/2)[(-1.8t3-3.9t2+13.2t)2(2.7t2+10.2t)]dt/∫t[(-1.8t3-3.9t2+13.2t)(2.7t2+10.2t)]dt = (1/2)(244.94/37.26) = 3.28

BAM!

Thanks for the guidence.

I did find something in a textbook regarding the substitution of t. But still a little unclear how the substitution works.
 

FAQ: Finding Centroid Coordinates Under Degree 3 Bezier Curve

What is a Degree 3 Bezier Curve?

A Degree 3 Bezier Curve is a type of mathematical curve used to represent smooth and continuous shapes in computer graphics and design. It is defined by a set of control points that determine the shape and position of the curve.

How do you find the centroid coordinates under a Degree 3 Bezier Curve?

To find the centroid coordinates under a Degree 3 Bezier Curve, you can use the formula (1/3)(P0 + P1 + P2), where P0, P1, and P2 are the control points of the curve. This will give you the coordinates of the point that is at one-third of the distance along the curve from the first control point to the last control point.

Can you explain the concept of centroid in relation to a Bezier Curve?

The centroid of a Bezier Curve is the point that divides the curve into two equal areas. It is also known as the center of gravity or balance point of the curve. This point is important in computer graphics and design as it helps determine the shape and position of the curve.

Are there any limitations to finding centroid coordinates under a Degree 3 Bezier Curve?

Yes, there are limitations to finding centroid coordinates under a Degree 3 Bezier Curve. This method only works for curves with three control points and cannot be applied to curves with more or less control points. Additionally, the curve must be smooth and continuous for this method to accurately determine the centroid coordinates.

How is finding centroid coordinates under a Degree 3 Bezier Curve useful?

Finding centroid coordinates under a Degree 3 Bezier Curve is useful for various applications in computer graphics and design. It can help determine the center of gravity of a shape, which is important for balancing and positioning objects in a design. It can also be used to calculate the area of a shape or to create smooth curves in animations and illustrations.

Similar threads

Back
Top