Calculation of circumference arc lengths (simple formula)

Source: Internet
Author: User
Tags acos
/* Java Script for online ellipse arc length Calculator
Author: Joe Bartok
Date: 10000l/2004 *
URL: http://www.oocities.org/web_sketches/ellipse_notes/ellipse_arc_length/ellipse_arc_length.html
Arc Length of Ellipse
Scope: First quadrant, 0 <= x <= r
Semi-axis lying on the X-axis, r =?
Semi-axis lying on the Y-axis, r =?
(X1> x2)... X1 =? X2 =? (? Is the input value)
------------ Onclick = "solve_arc_length ()"------------------
/

Function solve_arc_length ()
{
VaR Pi = math. Pi
VaR rad = PI/180.
VaR f= 100000
VaR f= 10000000000

VaR A = Document. arc_length.r.value
VaR B = Document. arc_length.r.value
VaR X1 = Document. arc_length.x1.value
VaR X2 = Document. arc_length.x2.value

VaR prma1 = math. ACOs (x1/)
VaR prma2 = math. ACOs (x2/)

VaR d = (prma2-prma1)/20

VaR Y1 = math. SQRT (A * a * Math. sin (prma1) * Math. sin (prma1) + B * Math. cos (prma1) * Math. cos (prma1 ))
Document. arc_length.prma_1.value = math. Round (F * prma1)/F
Document. arc_length.y_1.value = math. Round (F * Y1)/F
Document. arc_length.ny_1.value = math. Round (F * Y1)/F

VaR y2 = math. SQRT (A * a * Math. sin (prma1 + 1 * D) * Math. sin (prma1 + 1 * D) + B * Math. cos (prma1 + 1 * D) * Math. cos (prma1 + 1 * D ))
Document. arc_length.prma_2.value = math. Round (F * (prma1 + 1 * D)/F
Document. arc_length.y_2.value = math. Round (F * Y2)/F
Document. arc_length.ny_2.value = math. Round (F * 4 * Y2)/F

VaR Y3 = math. SQRT (A * a * Math. sin (prma1 + 2 * D) * Math. sin (prma1 + 2 * D) + B * Math. cos (prma1 + 2 * D) * Math. cos (prma1 + 2 * D ))
Document. arc_length.prma_3.value = math. Round (F * (prma1 + 2 * D)/F
Document. arc_length.y_3.value = math. Round (F * Y3)/F
Document. arc_length.ny_3.value = math. Round (F * 2 * Y3)/F

VaR Y4 = math. SQRT (A * a * Math. sin (prma1 + 3 * D) * Math. sin (prma1 + 3 * D) + B * Math. cos (prma1 + 3 * D) * Math. cos (prma1 + 3 * D ))
Document. arc_length.prma_4.value = math. Round (F * (prma1 + 3 * D)/F
Document. arc_length.y_4.value = math. Round (F * Y4)/F
Document. arc_length.ny_4.value = math. Round (F * 4 * Y4)/F

VaR Y5 = math. SQRT (A * a * Math. sin (prma1 + 4 * D) * Math. sin (prma1 + 4 * D) + B * Math. cos (prma1 + 4 * D) * Math. cos (prma1 + 4 * D ))
Document. arc_length.prma_5.value = math. Round (F * (prma1 + 4 * D)/F
Document. arc_length.y_5.value = math. Round (F * Y5)/F
Document. arc_length.ny_5.value = math. Round (F * 2 * Y5)/F

VaR y6 = math. SQRT (A * a * Math. sin (prma1 + 5 * D) * Math. sin (prma1 + 5 * D) + B * Math. cos (prma1 + 5 * D) * Math. cos (prma1 + 5 * D ))
Document. arc_length.prma_6.value = math. Round (F * (prma1 + 5 * D)/F
Document. arc_length.y_6.value = math. Round (F * y6)/F
Document. arc_length.ny_6.value = math. Round (F * 4 * y6)/F

VaR y7 = math. SQRT (A * a * Math. sin (prma1 + 6 * D) * Math. sin (prma1 + 6 * D) + B * Math. cos (prma1 + 6 * D) * Math. cos (prma1 + 6 * D ))
Document. arc_length.prma_7.value = math. Round (F * (prma1 + 6 * D)/F
Document. arc_length.y_7.value = math. Round (F * y7)/F
Document. arc_length.ny_7.value = math. Round (F * 2 * y7)/F

VaR Y8 = math. SQRT (A * a * Math. sin (prma1 + 7 * D) * Math. sin (prma1 + 7 * D) + B * Math. cos (prma1 + 7 * D) * Math. cos (prma1 + 7 * D ))
Document. arc_length.prma_8.value = math. Round (F * (prma1 + 7 * D)/F
Document. arc_length.y_8.value = math. Round (F * Y8)/F
Document. arc_length.ny_8.value = math. Round (F * 4 * Y8)/F

VaR y9 = math. SQRT (A * a * Math. sin (prma1 + 8 * D) * Math. sin (prma1 + 8 * D) + B * Math. cos (prma1 + 8 * D) * Math. cos (prma1 + 8 * D ))
Document. arc_length.prma_9.value = math. Round (F * (prma1 + 8 * D)/F
Document. arc_length.y_9.value = math. Round (F * y9)/F
Document. arc_length.ny_9.value = math. Round (F * 2 * y9)/F

VaR Y10 = math. SQRT (A * a * Math. sin (prma1 + 9 * D) * Math. sin (prma1 + 9 * D) + B * Math. cos (prma1 + 9 * D) * Math. cos (prma1 + 9 * D ))
Document. arc_length.prma_10.value = math. Round (F * (prma1 + 9 * D)/F
Document. arc_length.y_10.value = math. Round (F * Y10)/F
Document. arc_length.ny_10.value = math. Round (F * 4 * Y10)/F

VaR y11 = math. SQRT (A * a * Math. sin (prma1 + 10 * D) * Math. sin (prma1 + 10 * D) + B * Math. cos (prma1 + 10 * D) * Math. cos (prma1 + 10 * D ))
Document. arc_length.prma_11.value = math. Round (F * (prma1 + 10 * D)/F
Document. arc_length.y_11.value = math. Round (F * y11)/F
Document. arc_length.ny_11.value = math. Round (F * 2 * y11)/F

VaR Y12 = math. SQRT (A * a * Math. sin (prma1 + 11 * D) * Math. sin (prma1 + 11 * D) + B * Math. cos (prma1 + 11 * D) * Math. cos (prma1 + 11 * D ))
Document. arc_length.prma_12.value = math. Round (F * (prma1 + 11 * D)/F
Document. arc_length.y_12.value = math. Round (F * Y12)/F
Document. arc_length.ny_12.value = math. Round (F * 4 * Y12)/F

VaR Y13 = math. SQRT (A * a * Math. sin (prma1 + 12 * D) * Math. sin (prma1 + 12 * D) + B * Math. cos (prma1 + 12 * D) * Math. cos (prma1 + 12 * D ))
Document. arc_length.prma_13.value = math. Round (F * (prma1 + 12 * D)/F
Document. arc_length.y_13.value = math. Round (F * Y13)/F
Document. arc_length.ny_13.value = math. Round (F * 2 * Y13)/F

VaR Y14 = math. SQRT (A * a * Math. sin (prma1 + 13 * D) * Math. sin (prma1 + 13 * D) + B * Math. cos (prma1 + 13 * D) * Math. cos (prma1 + 13 * D ))
Document. arc_length.prma_14.value = math. Round (F * (prma1 + 13 * D)/F
Document. arc_length.y_14.value = math. Round (F * Y14)/F
Document. arc_length.ny_14.value = math. Round (F * 4 * Y14)/F

VaR Y15 = math. SQRT (A * a * Math. sin (prma1 + 14 * D) * Math. sin (prma1 + 14 * D) + B * Math. cos (prma1 + 14 * D) * Math. cos (prma1 + 14 * D ))
Document. arc_length.prma_15.value = math. Round (F * (prma1 + 14 * D)/F
Document. arc_length.y_15.value = math. Round (F * Y15)/F
Document. arc_length.ny_15.value = math. Round (F * 2 * Y15)/F

VaR Y16 = math. SQRT (A * a * Math. sin (prma1 + 15 * D) * Math. sin (prma1 + 15 * D) + B * Math. cos (prma1 + 15 * D) * Math. cos (prma1 + 15 * D ))
Document. arc_length.prma_16.value = math. Round (F * (prma1 + 15 * D)/F
Document. arc_length.y_16.value = math. Round (F * Y16)/F
Document. arc_length.ny_16.value = math. Round (F * 4 * Y16)/F

VaR Y17 = math. SQRT (A * a * Math. sin (prma1 + 16 * D) * Math. sin (prma1 + 16 * D) + B * Math. cos (prma1 + 16 * D) * Math. cos (prma1 + 16 * D ))
Document. arc_length.prma_17.value = math. Round (F * (prma1 + 16 * D)/F
Document. arc_length.y_17.value = math. Round (F * Y17)/F
Document. arc_length.ny_17.value = math. Round (F * 2 * Y17)/F

VaR Y18 = math. SQRT (A * a * Math. sin (prma1 + 17 * D) * Math. sin (prma1 + 17 * D) + B * Math. cos (prma1 + 17 * D) * Math. cos (prma1 + 17 * D ))
Document. arc_length.prma_18.value = math. Round (F * (prma1 + 17 * D)/F
Document. arc_length.y_18.value = math. Round (F * Y18)/F
Document. arc_length.ny_18.value = math. Round (F * 4 * Y18)/F

VaR y19 = math. SQRT (A * a * Math. sin (prma1 + 18 * D) * Math. sin (prma1 + 18 * D) + B * Math. cos (prma1 + 18 * D) * Math. cos (prma1 + 18 * D ))
Document. arc_length.prma_19.value = math. Round (F * (prma1 + 18 * D)/F
Document. arc_length.y_19.value = math. Round (F * y19)/F
Document. arc_length.ny_19.value = math. Round (F * 2 * y19)/F

VaR Y20 = math. SQRT (A * a * Math. sin (prma1 + 19 * D) * Math. sin (prma1 + 19 * D) + B * Math. cos (prma1 + 19 * D) * Math. cos (prma1 + 19 * D ))
Document. arc_length.prma_1_value = math. Round (F * (prma1 + 19 * D)/F
Document. arc_length.y_1_value = math. Round (F * Y20)/F
Document. arc_length.ny_1_value = math. Round (F * 4 * Y20)/F

VaR Y21 = math. SQRT (A * a * Math. sin (prma1 + 20 * D) * Math. sin (prma1 + 20 * D) + B * Math. cos (prma1 + 20 * D) * Math. cos (prma1 + 20 * D ))
Document. arc_length.prma_21.value = math. Round (F * (prma1 + 20 * D)/F
Document. arc_length.y_21.value = math. Round (F * Y21)/F
Document. arc_length.ny_21.value = math. Round (F * Y21)/F

VaR D_3 = D/3
VaR y_sum = 1 * Y1 + 4 * y2 + 2 * Y3 + 4 * Y4 + 2 * Y5 + 4 * y6 + 2 * y7 + 4 * Y8 + 2 * y9 + 4 * Y10 + 2 * y11 + 4 * Y12 + 2 * Y13 + 4 * Y14 + 2 * Y15 + 4 * Y16 + 2 * Y17 + 4 * Y18 + 2 * y19 + 4 * Y20 + 1 * Y21
VaR S = (D/3) * (1 * Y1 + 4 * y2 + 2 * Y3 + 4 * Y4 + 2 * Y5 + 4 * y6 + 2 * y7 + 4 * Y8 + 2 * y9 + 4 * y10 + 2 * y11 + 4 * Y12 + 2 * Y13 + 4 * Y14 + 2 * Y15 + 4 * Y16 + 2 * Y17 + 4 * Y18 + 2 * y19 + 4 * y20 + 1 * Y21)

Document. arc_length.d_3.value = math. Round (F * D_3)/F
Document. arc_length.y_sum.value = math. Round (F * y_sum)/F
Document. arc_length.prma1.value = math. Round (F * prma1)/F
Document. arc_length.prma2.value = math. Round (F * prma2)/F
Document. arc_length.d.value = math. Round (F * D)/F
Document. arc_length.arc_calc.value = math. round (F * D_3)/F + "×" + math. round (F * y_sum)/F + "=" + math. round (F * s)/F
Window. Status = "ellipse arc length =" + math. Round (F * s)/F

VaR dx = (x1-X2)/20

VaR yc1 = math. SQRT (1 + B * B * X2 * x2/(A * a * (A * A-X2 * x2 )))
VaR yc2 = math. SQRT (1 + B * B * (1 * X2 + 1 * dx) * (1 * X2 + 1 * dx) /(A * a * (A * A-(1 * X2 + 1 * dx) * (1 * X2 + 1 * dx ))))
VaR yc3 = math. SQRT (1 + B * B * (1 * X2 + 2 * dx) * (1 * X2 + 2 * dx) /(A * a * (A * A-(1 * X2 + 2 * dx) * (1 * X2 + 2 * dx ))))
VaR yc4 = math. SQRT (1 + B * B * (1 * X2 + 3 * dx) * (1 * X2 + 3 * dx) /(A * a * (A * A-(1 * X2 + 3 * dx) * (1 * X2 + 3 * dx ))))
VaR yc5 = math. SQRT (1 + B * B * (1 * X2 + 4 * dx) * (1 * X2 + 4 * dx) /(A * a * (A * A-(1 * X2 + 4 * dx) * (1 * X2 + 4 * dx ))))
VaR yc6 = math. SQRT (1 + B * B * (1 * X2 + 5 * dx) * (1 * X2 + 5 * dx) /(A * a * (A * A-(1 * X2 + 5 * dx) * (1 * X2 + 5 * dx ))))
VaR yc7 = math. SQRT (1 + B * B * (1 * X2 + 6 * dx) * (1 * X2 + 6 * dx) /(A * a * (A * A-(1 * X2 + 6 * dx) * (1 * X2 + 6 * dx ))))
VaR yc8 = math. SQRT (1 + B * B * (1 * X2 + 7 * dx) * (1 * X2 + 7 * dx) /(A * a * (A * A-(1 * X2 + 7 * dx) * (1 * X2 + 7 * dx ))))
VaR yc9 = math. SQRT (1 + B * B * (1 * X2 + 8 * dx) * (1 * X2 + 8 * dx) /(A * a * (A * A-(1 * X2 + 8 * dx) * (1 * X2 + 8 * dx ))))
VaR yc10 = math. SQRT (1 + B * B * (1 * X2 + 9 * dx) * (1 * X2 + 9 * dx) /(A * a * (A * A-(1 * X2 + 9 * dx) * (1 * X2 + 9 * dx ))))
VaR yc11 = math. SQRT (1 + B * B * (1 * X2 + 10 * dx) * (1 * X2 + 10 * dx) /(A * a * (A * A-(1 * X2 + 10 * dx) * (1 * X2 + 10 * dx ))))
VaR yc12 = math. SQRT (1 + B * B * (1 * X2 + 11 * dx) * (1 * X2 + 11 * dx) /(A * a * (A * A-(1 * X2 + 11 * dx) * (1 * X2 + 11 * dx ))))
VaR yc13 = math. SQRT (1 + B * B * (1 * X2 + 12 * dx) * (1 * X2 + 12 * dx) /(A * a * (A * A-(1 * X2 + 12 * dx) * (1 * X2 + 12 * dx ))))
VaR yc14 = math. SQRT (1 + B * B * (1 * X2 + 13 * dx) * (1 * X2 + 13 * dx) /(A * a * (A * A-(1 * X2 + 13 * dx) * (1 * X2 + 13 * dx ))))
VaR yc15 = math. SQRT (1 + B * B * (1 * X2 + 14 * dx) * (1 * X2 + 14 * dx) /(A * a * (A * A-(1 * X2 + 14 * dx) * (1 * X2 + 14 * dx ))))
VaR yc16 = math. SQRT (1 + B * B * (1 * X2 + 15 * dx) * (1 * X2 + 15 * dx) /(A * a * (A * A-(1 * X2 + 15 * dx) * (1 * X2 + 15 * dx ))))
VaR yc17 = math. SQRT (1 + B * B * (1 * X2 + 16 * dx) * (1 * X2 + 16 * dx) /(A * a * (A * A-(1 * X2 + 16 * dx) * (1 * X2 + 16 * dx ))))
VaR yc6 = math. SQRT (1 + B * B * (1 * X2 + 17 * dx) * (1 * X2 + 17 * dx) /(A * a * (A * A-(1 * X2 + 17 * dx) * (1 * X2 + 17 * dx ))))
VaR yc19 = math. SQRT (1 + B * B * (1 * X2 + 18 * dx) * (1 * X2 + 18 * dx) /(A * a * (A * A-(1 * X2 + 18 * dx) * (1 * X2 + 18 * dx ))))
VaR yc20 = math. SQRT (1 + B * B * (1 * X2 + 19 * dx) * (1 * X2 + 19 * dx) /(A * a * (A * A-(1 * X2 + 19 * dx) * (1 * X2 + 19 * dx ))))
VaR yc21 = math. SQRT (1 + B * B * (1 * X2 + 20 * dx) * (1 * X2 + 20 * dx) /(A * a * (A * A-(1 * X2 + 20 * dx) * (1 * X2 + 20 * dx ))))

VaR c_arc = (dx/3) * (1 * yc1 + 4 * yc2 + 2 * yc3 + 4 * yc4 + 2 * yc5 + 4 * yc6 + 2 * yc7 + 4 * yc8 + 2 * yc9 + 4 * yc10 + 2 * yc11 + 4 * yc12 + 2 * yc13 + 4 * yc14 + 2 * yc15 + 4 * yc16 + 2 * yc17 +
4 * yc6 + 2 * yc19 + 4 * yc20 + 1 * yc21)

Document. arc_length.c_arc.value = math. Round (F * c_arc)/F
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.