Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Formula for a curve

Featured Replies

Would someone help me determine the formular for a curve that plots to these values:If Miles = 0, then Offset = 5;If Miles = 10, then Offset = 500;If Miles = 20, then Offset =2000.I would like to have a formula that would calculate the Offset for any known value of Miles between 0 and 20 and would be xml friendly.Thanks,Glenn

Hi,(Long tima ago??????????????????????)Looks like something as a parabole:y = ax2 + b Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Commercial Member

>Would someone help me determine the formular for a curve that>plots to these values:>If Miles = 0, then Offset = 5;>If Miles = 10, then Offset = 500;>If Miles = 20, then Offset =2000.>I would like to have a formula that would calculate the Offset>for any known value of Miles between 0 and 20 and would be xml>friendly.>Thanks,>Glenn>What you're wanting to do is called forecasting in statistics.It's not really complex... but it would be in XML. I don't do XML... but I do C... here's a C version... maybe you can translate it?FLOAT64 Offset_By_Miles(FLOAT64 miles_index){ FLOAT64 Miles[3] = {0,10,20}; FLOAT64 Offset[3] = {5,500,2000}; int i; FLOAT64 sx, sy, xmean, ymean, sxx, sxy, syy, x, y; FLOAT64 B0, B1; //{compute basic sums} sx = 0.0; sy = 0.0; sxx = 0.0; sxy = 0.0; syy = 0.0; for (i = 0; i < 3; i++) { x = Miles; y = Offset; sx = sx+x; sy = sy+y; sxx = sxx+x*x; syy = syy+y*y; sxy = sxy+x*y; } xmean = sx/(float)3; <<- number of items ymean = sy/(float)3; sxx = sxx-(float)3*xmean*xmean; syy = syy-(float)3*ymean*ymean; sxy = sxy-(float)3*xmean*ymean; //{check for zero variance} if (sxx <= 0.0) { // bad return 0; } B1 = sxy/sxx; B0 = ymean-B1*xmean; // forecast Y based on X; return B0+B1*miles_index; //2049.75}

Ed Wilson

Mindstar Aviation
My Playland - I69

Glenn,(miles) sp0l0 sqr 5.025 * l0 0.75 * - 5 + (>Offset)2nd order polinomial, R2=1Hope this helps.Tom

Hi,Tom was first!Old dutch mathematics for parabole:y (offset) = ax2 + bx + cYour data 0-5; 10-500; 20-2000So c = 5and after some calc a = 5.025 and b = -0.75That gives y = 5.025 * Miles2 - 0.75 * miles + 5 in xml:(L:Miles,number) (L:Miles,number) * 5.025 * (L:Miles,number) 0.75 * - 5 + (>L:Offset,number) "Mustard after meal"Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

""and after some calc""Not too much calcs indeed, aprox. 30 secs to find the formula in Excel. :-)Tom

Great, thanks, guys. I'll put these to the test over the weekend.Glenn

Yeah Tom got in before me, but if you plot curves in Excel it can tell you the formula, especially if it has a regular mathematical shape.cheers,nick

My daughter has been praising Excel for years. They gave me MS Office for Christmas because my old Word 97 was coughing up blood if graphics got a bit heavy. I've never run anything in the Office suite other than Word. I always thought Excel was just a spreadsheet for business applications such as taxes, etc. I'll definitely look into it now. Thanks for the tip.Glenn

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.