The SKIRT project
advanced radiative transfer for astrophysics
pts.visual.rgbimage._CubicSpline Class Reference

An instance of the CubicSpline class implements a function \(y=f(x)\) composed of three cubic spline segments of the form \(y=ax^3+bx^2+cx+d\). More...

Public Member Functions

 __init__ (self, point1, point2)
 ay (self, x)
 y (self, x)

Public Attributes

 a1
 a2
 a3
int b1
 b2
 b3
 c1
 c2
 c3
int d1
 d2
 d3
result x1
result x2

Detailed Description

An instance of the CubicSpline class implements a function \(y=f(x)\) composed of three cubic spline segments of the form \(y=ax^3+bx^2+cx+d\).

The function is constrained as follows:

  • the function is defined only for \(x\) values in the interval [0,1]
  • the function goes through the four points \((0,0),\,(x_1,y_1),\,(x_2,y_2),\,(1,1)\) with \(0<x_1<x_2<1\), where the outer points are fixed and the inner points are provided as arguments to the constructor
  • the function's first and second derivatives are continuous at the inner points
  • the function's second derivative is zero at the outer points ("natural bounding conditions")
  • regardless of the form dictated by the spline segments, the \(y\) value is always clipped to the interval [0,1]

The documentation for this class was generated from the following file: