summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/2geom/src/python/exact-arc-length-quad-bez.py
blob: fd2f4b35ba409716303df6487e2de40ce79b703d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import math

def q(x, a, b, c):
    sa = math.sqrt(a)
    y = math.sqrt(a*x*x+b*x+c)
    dp = 2*a*x + b
    r = dp*y/(4*a)
    t = abs(dp + 2*y*sa)
    s = (4*a*c-b*b)/(a*sa*8)
    return r+s*math.log(t)

a = 1160390
b = -922658
c = 249477
print q(1, a,b,c) - q(0,a,b,c)