├── readme.org ├── img ├── readme.org └── RBC_Effect_of_weights.png └── Rational Bezier Curve.org /readme.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Math Notes 2 | -------------------------------------------------------------------------------- /img/readme.org: -------------------------------------------------------------------------------- 1 | All the related images are here. 2 | -------------------------------------------------------------------------------- /img/RBC_Effect_of_weights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cafe/math/master/img/RBC_Effect_of_weights.png -------------------------------------------------------------------------------- /Rational Bezier Curve.org: -------------------------------------------------------------------------------- 1 | * Bézier Curve 2 | 3 | (From [[http://mathworld.wolfram.com/BezierCurve.html][MathWord]]) 4 | 5 | Given a set of n+1 control points P_{0}, P_{1}, ..., P_{n}, the corresponding Bézier curve (or Bernstein-Bézier curve) is given by (in /LaTeX/) 6 | 7 | #+BEGIN_SRC latex 8 | C(t)=\sum_{i=0}^n P_i B_{i,n}(t) 9 | #+END_SRC 10 | 11 | i.e., 12 | 13 | #+BEGIN_EXAMPLE 14 | __ n 15 | C(t) = \ P B (t) 16 | /__ i = 0 i i,n 17 | #+END_EXAMPLE 18 | 19 | where B_{i,n}(t) is a Bernstein polynomial and t in [0,1]. Bézier splines are implemented in the Wolfram Language as =BezierCurve[pts]=. 20 | 21 | * Rational Bézier curve 22 | 23 | Given n + 1 control points P_{i} with w_{0} = w_{n} = 1, the "rational" Bézier curve is defined by (in /LaTeX/) 24 | 25 | #+BEGIN_SRC latex 26 | C(t)=\frac{\sum_{i=0}^n B_{i,n}(t) w_i P_i}{\sum_{i=0}^n B_{i,n}(t) w_i} 27 | #+END_SRC 28 | 29 | i.e., 30 | 31 | #+BEGIN_EXAMPLE 32 | __ n 33 | \ B (t) w P 34 | /__ i = 0 i,n i i 35 | C(t) = ----------------------- 36 | __ n 37 | \ B (t) w 38 | /__ i = 0 i,n i 39 | #+END_EXAMPLE 40 | 41 | or simply (in /LaTeX/) 42 | 43 | #+BEGIN_SRC latex 44 | C(t)=\frac {\sum _{i=0}^{n}{n \choose i}t^{i}(1-t)^{n-i} P_{i} w_{i}} 45 | {\sum _{i=0}^{n}{n \choose i}t^{i}(1-t)^{n-i}w_{i}} 46 | #+END_SRC 47 | 48 | i.e., 49 | 50 | #+BEGIN_EXAMPLE 51 | __ n i n - i 52 | \ {n choose i}t (1 - t) P w 53 | /__ i = 0 i i 54 | C(t) = ------------------------------------------ 55 | __ n i n - i 56 | \ {n choose i}t (1 - t) w 57 | /__ i = 0 i 58 | #+END_EXAMPLE 59 | 60 | where n is the order, B_{i,n} are the Bernstein polynomials, P_{i} are control points, and the weight w_{i} (nonnegative values) of P_{i} is the last ordinate of the homogeneous point P_{i}^{w}. These curves are closed under perspective transformations, and can represent conic sections exactly. 61 | 62 | ** Properties: 63 | 64 | 1. If all w_{i} = 1, then we get the polynomial Bézier curves. 65 | 2. C(0) = P_{0}, C(1) = P_{n} (endpoint interpolation) 66 | 3. C(t) \subseteq [P_{0}, ..., P_{n}] (convex hull property) 67 | 4. The curve is tangent to the control polygon in the endpoints. 68 | 69 | ** Properties of the weights: 70 | 71 | 1. For w_{0} = w_{1} = ... = w_{n} = 1, the rational Bézier curve is equal to a polynomial Bézier curve. 72 | 2. Multiplication of all weights with a common factor does not change the curve. 73 | 3. More generally, if for all ratios 74 | 75 | #+BEGIN_EXAMPLE 76 | w w 77 | i i + 1 78 | ------:------ = const 79 | w w 80 | i + 1 i + 2 81 | 82 | LaTeX: \frac{w_{i}}{w_{i+1}}:\frac{w_{i+1}}{w_{i+2}} = const 83 | #+END_EXAMPLE 84 | 85 | then the curve has the same shape but another parametrization. 86 | 87 | 4. Increasing the weight w_{k} pulls the curve to the control point P_{k}. Decreasing the weight w_{k} pushes the curve away from the control point P_{k}. 88 | 5. In the limit case, when w_{k} approaches infinity, C(t) = P_{k} 89 | 90 | Effect of the weights (n = 2): 91 | 92 | [[./img/RBC_Effect_of_weights.png?raw=true]] 93 | --------------------------------------------------------------------------------