Posted By: vault | Jun 23rd @ 2:53 AM
page 1 of 1
Comments: 17 | Views: 469

I have an x-axis and y-axis that are equal. I need to measure the red line in VB

Which is the best way?

Am I missing something or is the red line just a random curve?

Dr Herbie
Dr Herbie
Horses for courses

I would say that you would have to divide the curve up into small sections and measure each section.  Are you looking for the area under the curve?  If so, you can split the x-axis into 1-pixel sections and just add the y-axis values together assuming you have values for each pixel.  If you don't have pixel-by-pixel readings you'll just have to split into the smallest sized bits you can and get an approximate answer.

Do you have all the 'raw' data for drawing the line, or are you only able to access the image on-screen?  If you can only access the image, that's not someting I know how to measure Smiley

Herbie

 

SlackmasterK
SlackmasterK
I write my OWN blogging engines

x2   or x2 - 5

And I never even learned trig, picked that up in alg.

 I'm assuming you messed up the line a bit.

Dr Herbie
Dr Herbie
Horses for courses

But both axes have the same maximum value, so at the right hand side, Y= X, not Y = X2

I'm not good at trig or algebra, so I may just be confused.

Herbie

We know that at every single point prior to the maximum on the red line y<x, since the line y=x is repesented by the black diagonal, so it definitely isn't x2

MasterPie
MasterPie
I'm white because I smelt an onion

Isn't that a hyperbola shifted to the right 100 units?

(x-100)^2/100 - y^2/100 = 1

And then the arc length (I think...haven't done arc length for a while) of just the region from 0 to 100 is defined as the integral from 0 to 100 of the sqrt(1 + dy/dx[ (x-100)^2/100 - y^2/100 ] ).

EDIT: Whoops, didn't see his reply.

Matthew van Eerde
Matthew van Eerde
AKA Maurits

I'm a little confused - can you post all the information you have about the problem again?

I once used a countur tracing algorithm, to calculate how many pixels (and where) there are.

I can try to find it out when I reach home.  It's writen in C++.

Bass
Bass
www.s​preadfirefox.c​om/5years/

This seems to be a calculus problem. I don't remember learning this in trig.

Bass
Bass
www.s​preadfirefox.c​om/5years/

Or you can use the Monte Carlo intergration algorithm (you can do it on a bitmap aswell), which is faster and l33ter then adding pixels. You want to be 1337 don't you? Cool

Charles
Charles
Welcome Change

Just post your homework assignment in full, OK? Smiley
C

CannotResolveSymbol
CannotResolveSymbol
{insert caption here}

Yes, it's not a trig problem.  You can estimate the line length without calculus, though:  just divide the path into segments and calculate the length of a straight line between those segments.

Finding an exact answer would require calculus, if it's possible at all (arc length often requires numerical integration as described above, as you don't always get a closed-form solution to the arc length integral).

Bass
Bass
www.s​preadfirefox.c​om/5years/

Finding the antiderivative of a function even if it exists in closed form is extremely difficult algorithmly. I'm pretty sure there doesn't even exists any software which can do this. Mathematica comes close.


For all particial purposes Monte Carlo methods will get very close estimations (+/- 0.0001) with little computing power. But since it's a stochastic (random) algorithm, there is a possibility it will output a completely incorrect answer. Comforting that they used this algorithm to design nuclear weapons, eh?

CannotResolveSymbol
CannotResolveSymbol
{insert caption here}

It's difficult, but not impossible (although I'm not claiming that I could write such an algorithm, nor that the original poster should).  Derive was among the first computer algebra systems to be good at symbolic integration; Mathematica and Maple are also quite competent in the field as well (try it:  arc length of x^2 according to Mathematica).  TI calculators (the 89 series and up) are also pretty good at symbolic integration (as they should be; their software is based on Derive).

With a simple curve like an exponential or logarithmic curve, Monte Carlo is probably overkill (although it could be helpful if your curve of choice has lots of fine details).  Simply partitioning the curve into a fixed number of equal partitions should be adequate provided your partitions are small enough.

When you say "measure" did you mean you want to calculate the length, or just determine the location of the points to draw a graph? Also, the linear or cubic curves do not look like the one in your first post. A mathematical function like y=100^(x/100) would create a curve like you describe, and would start at (0,1) and end at (100,100). Is that close enough?

Dr Herbie
Dr Herbie
Horses for courses

If you wanted, you could enter some data points into excel and get it to calculate the best regression line through those points ...  you can select the type of formula that Excel should use and it will do the rest.

Herbie

page 1 of 1
Comments: 17 | Views: 469
Microsoft Communities