Skip to content

helpers

bic_vals

p0 staticmethod

p0(b: float, c: float) -> float
Source code
 9
10
11
@staticmethod
def p0(b: float, c: float) -> float:
    return (6.0 - 2.0 * b) / 6.0

p2 staticmethod

p2(b: float, c: float) -> float
Source code
13
14
15
@staticmethod
def p2(b: float, c: float) -> float:
    return (-18.0 + 12.0 * b + 6.0 * c) / 6.0

p3 staticmethod

p3(b: float, c: float) -> float
Source code
17
18
19
@staticmethod
def p3(b: float, c: float) -> float:
    return (12.0 - 9.0 * b - 6.0 * c) / 6.0

q0 staticmethod

q0(b: float, c: float) -> float
Source code
21
22
23
@staticmethod
def q0(b: float, c: float) -> float:
    return (8.0 * b + 24.0 * c) / 6.0

q1 staticmethod

q1(b: float, c: float) -> float
Source code
25
26
27
@staticmethod
def q1(b: float, c: float) -> float:
    return (-12.0 * b - 48.0 * c) / 6.0

q2 staticmethod

q2(b: float, c: float) -> float
Source code
29
30
31
@staticmethod
def q2(b: float, c: float) -> float:
    return (6.0 * b + 30.0 * c) / 6.0

q3 staticmethod

q3(b: float, c: float) -> float
Source code
33
34
35
@staticmethod
def q3(b: float, c: float) -> float:
    return (-b - 6.0 * c) / 6.0

poly3

poly3(x: float, c0: float, c1: float, c2: float, c3: float) -> float
Source code
42
43
def poly3(x: float, c0: float, c1: float, c2: float, c3: float) -> float:
    return c0 + x * (c1 + x * (c2 + x * c3))

round_halfup

round_halfup(x: float) -> float
Source code
46
47
def round_halfup(x: float) -> float:
    return floor(x + 0.5) if x < 0 else floor(x + 0.49999999999999994)

sinc

sinc(x: float) -> float
Source code
38
39
def sinc(x: float) -> float:
    return 1.0 if x == 0.0 else sin(x * pi) / (x * pi)