1"use strict";(self.webpackChunkcetz_documentation=self.webpackChunkcetz_documentation||[]).push([[937],{6565:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>se,contentTitle:()=>ce,default:()=>de,frontMatter:()=>oe,metadata:()=>ie,toc:()=>ae});var r=n(4848),o=n(8453);function c(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||s("Function",!0),n||s("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"quadratic-point",parameters:{a:{types:"vector"},b:{types:"vector"},c:{types:"vector"},t:{types:"float"}}}),"\n",(0,r.jsxs)("p",{children:["Get the point on quadratic bezier at position ",(0,r.jsx)("code",{children:"t"}),"."]}),"\n",(0,r.jsx)(n,{name:"a",types:"vector",children:(0,r.jsx)("p",{children:"Start point"})}),"\n",(0,r.jsx)(n,{name:"b",types:"vector",children:(0,r.jsx)("p",{children:"End point"})}),"\n",(0,r.jsx)(n,{name:"c",types:"vector",children:(0,r.jsx)("p",{children:"Control point"})}),"\n",(0,r.jsx)(n,{name:"t",types:"float",children:(0,r.jsx)("p",{children:"Position on curve"})})]})}function i(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}function s(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function a(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||d("Function",!0),n||d("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"quadratic-derivative",parameters:{a:{types:"vector"},b:{types:"vector"},c:{types:"vector"},t:{types:"float"}}}),"\n",(0,r.jsxs)("p",{children:["Get the derivative (dx/dt) of a quadratic bezier at position ",(0,r.jsx)("code",{children:"t"}),"."]}),"\n",(0,r.jsx)(n,{name:"a",types:"vector",children:(0,r.jsx)("p",{children:"Start point"})}),"\n",(0,r.jsx)(n,{name:"b",types:"vector",children:(0,r.jsx)("p",{children:"End point"})}),"\n",(0,r.jsx)(n,{name:"c",types:"vector",children:(0,r.jsx)("p",{children:"Control point"})}),"\n",(0,r.jsx)(n,{name:"t",types:"float",children:(0,r.jsx)("p",{children:"Position on curve [0, 1]"})})]})}function p(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}function d(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function l(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||u("Function",!0),n||u("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"cubic-point",parameters:{a:{types:"vector"},b:{types:"vector"},c1:{types:"vector"},c2:{types:"vector"},t:{types:"float"}}}),"\n",(0,r.jsxs)("p",{children:["Get the point on a cubic bezier curve at position ",(0,r.jsx)("code",{children:"t"}),"."]}),"\n",(0,r.jsx)(n,{name:"a",types:"vector",children:(0,r.jsx)("p",{children:"Start point"})}),"\n",(0,r.jsx)(n,{name:"b",types:"vector",children:(0,r.jsx)("p",{children:"End point"})}),"\n",(0,r.jsx)(n,{name:"c1",types:"vector",children:(0,r.jsx)("p",{children:"Control point 1"})}),"\n",(0,r.jsx)(n,{name:"c2",types:"vector",children:(0,r.jsx)("p",{children:"Control point 2"})}),"\n",(0,r.jsx)(n,{name:"t",types:"float",children:(0,r.jsx)("p",{children:"Position on curve [0, 1]"})})]})}function h(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}function u(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function x(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||m("Function",!0),n||m("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"cubic-derivative",parameters:{a:{types:"vector"},b:{types:"vector"},c1:{types:"vector"},c2:{types:"vector"},t:{types:"float"}}}),"\n",(0,r.jsxs)("p",{children:["Get the derivative (dx/dt) of a cubic bezier at position ",(0,r.jsx)("code",{children:"t"}),"."]}),"\n",(0,r.jsx)(n,{name:"a",types:"vector",children:(0,r.jsx)("p",{children:"Start point"})}),"\n",(0,r.jsx)(n,{name:"b",types:"vector",children:(0,r.jsx)("p",{children:"End point"})}),"\n",(0,r.jsx)(n,{name:"c1",types:"vector",children:(0,r.jsx)("p",{children:"Control point 1"})}),"\n",(0,r.jsx)(n,{name:"c2",types:"vector",children:(0,r.jsx)("p",{children:"Control point 2"})}),"\n",(0,r.jsx)(n,{name:"t",types:"float",children:(0,r.jsx)("p",{children:"Position on curve [0, 1]"})})]})}function j(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(x,{...e})}):x(e)}function m(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function v(e){const t={em:"em",...(0,o.R)(),...e.components},{Function:n,Parameter:c}=t;return n||b("Function",!0),c||b("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n,{name:"to-abc",parameters:{s:{types:"vector"},e:{types:"vector"},B:{types:"vector"},t:{types:"float"},deg:{types:"int"}}}),"\n",(0,r.jsx)("p",{children:"Get a bezier curve\u2019s ABC coordinates. Returns them as a respective array</Type> of vector</Type>s."}),"\n",(0,r.jsx)("pre",{children:(0,r.jsxs)("code",{children:[" /A\\ <-- Control point of quadratic bezier",(0,r.jsx)("br",{})," / | <br /> / | <br /> /",(0,r.jsx)(t.em,{children:".-B-."}),"\\ <-- Point on curve",(0,r.jsx)("br",{})," ,' | ',",(0,r.jsx)("br",{})," / | <br /> s------C------e <-- Point on line between s and e"]})}),"\n",(0,r.jsx)(c,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Curve start"})}),"\n",(0,r.jsx)(c,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Curve end"})}),"\n",(0,r.jsx)(c,{name:"B",types:"vector",children:(0,r.jsx)("p",{children:"Point on curve"})}),"\n",(0,r.jsx)(c,{name:"t",types:"float",children:(0,r.jsx)("p",{children:"Position on curve"})}),"\n",(0,r.jsx)(c,{name:"deg",types:"int",children:(0,r.jsx)("p",{children:"Bezier degree (2 or 3)"})})]})}function y(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(v,{...e})}):v(e)}function b(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function f(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||w("Function",!0),n||w("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"quadratic-through-3points",parameters:{s:{types:"vector"},e:{types:"vector"},B:{types:"vector"}}}),"\n",(0,r.jsx)("p",{children:"Compute the control points for a quadratic bezier through 3 points."}),"\n",(0,r.jsx)(n,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Curve start"})}),"\n",(0,r.jsx)(n,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Curve end"})}),"\n",(0,r.jsx)(n,{name:"B",types:"vector",children:(0,r.jsx)("p",{children:"A point which the curve passes through"})})]})}function g(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(f,{...e})}):f(e)}function w(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function C(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||R("Function",!0),n||R("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"quadratic-to-cubic",parameters:{s:{types:"vector"},e:{types:"vector"},c:{types:"vector"}}}),"\n",(0,r.jsx)("p",{children:"Convert a quadratic bezier to a cubic bezier."}),"\n",(0,r.jsx)(n,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Curve start"})}),"\n",(0,r.jsx)(n,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Curve end"})}),"\n",(0,r.jsx)(n,{name:"c",types:"vector",children:(0,r.jsx)("p",{children:"Control point"})})]})}function F(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(C,{...e})}):C(e)}function R(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function P(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||E("Function",!0),n||E("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"cubic-through-3points",parameters:{s:{types:"vector"},e:{types:"vector"},B:{types:"vector"}}}),"\n",(0,r.jsx)("p",{children:"Compute the control points for a cubic bezier through 3 points."}),"\n",(0,r.jsx)(n,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Curve start"})}),"\n",(0,r.jsx)(n,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Curve end"})}),"\n",(0,r.jsx)(n,{name:"B",types:"vector",children:(0,r.jsx)("p",{children:"A point which the curve passes through"})})]})}function z(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(P,{...e})}):P(e)}function E(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function k(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||T("Function",!0),n||T("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"split",parameters:{s:{types:"vector"},e:{types:"vector"},c1:{types:"vector"},c2:{types:"vector"},t:{types:"float"}}}),"\n",(0,r.jsxs)("p",{children:["Split a cubic bezier into two cubic beziers at the point ",(0,r.jsx)("code",{children:"t"}),". Returns an array</Type> of two bezier</Type>. The first holds the original curve start ",(0,r.jsx)("code",{children:"s"}),", and the second holds the original curve end ",(0,r.jsx)("code",{children:"e"}),"."]}),"\n",(0,r.jsx)(n,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Curve start"})}),"\n",(0,r.jsx)(n,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Curve end"})}),"\n",(0,r.jsx)(n,{name:"c1",types:"vector",children:(0,r.jsx)("p",{children:"Control point 1"})}),"\n",(0,r.jsx)(n,{name:"c2",types:"vector",children:(0,r.jsx)("p",{children:"Control point 2"})}),"\n",(0,r.jsx)(n,{name:"t",types:"float",children:(0,r.jsx)("p",{children:"The point on the bezier to split,"})})]})}function q(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(k,{...e})}):k(e)}function T(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function B(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||S("Function",!0),n||S("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"cubic-arclen",parameters:{s:{types:"vector"},e:{types:"vector"},c1:{types:"vector"},c2:{types:"vector"}}}),"\n",(0,r.jsx)("p",{children:"Get the approximate cubic curve length"}),"\n",(0,r.jsx)(n,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Curve start"})}),"\n",(0,r.jsx)(n,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Curve end"})}),"\n",(0,r.jsx)(n,{name:"c1",types:"vector",children:(0,r.jsx)("p",{children:"Control point 1"})}),"\n",(0,r.jsx)(n,{name:"c2",types:"vector",children:(0,r.jsx)("p",{children:"Control point 2"})})]})}function A(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(B,{...e})}):B(e)}function S(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function G(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||D("Function",!0),n||D("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"cubic-shorten-linear",parameters:{s:{types:"vector"},e:{types:"vector"},c1:{types:"vector"},c2:{types:"vector"},d:{types:"float"}}}
1),"\n",(0,r.jsx)("p",{children:"Shorten the curve by offsetting s and c1 or e and c2 by distance d. If d is positive the curve gets shortened by moving s and c1 closer to e, if d is negative, e and c2 get moved closer to s."}),"\n",(0,r.jsx)(n,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Curve start"})}),"\n",(0,r.jsx)(n,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Curve end"})}),"\n",(0,r.jsx)(n,{name:"c1",types:"vector",children:(0,r.jsx)("p",{children:"Control point 1"})}),"\n",(0,r.jsx)(n,{name:"c2",types:"vector",children:(0,r.jsx)("p",{children:"Control point 2"})}),"\n",(0,r.jsx)(n,{name:"d",types:"float",children:(0,r.jsx)("p",{children:"Distance to shorten by"})})]})}function M(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(G,{...e})}):G(e)}function D(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function I(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||_("Function",!0),n||_("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"cubic-t-for-distance",parameters:{s:{types:"vector"},e:{types:"vector"},c1:{types:"vector"},c2:{types:"vector"},d:{types:"float"}}}),"\n",(0,r.jsxs)("p",{children:["Approximate bezier interval ",(0,r.jsx)("code",{children:"t"})," for a given distance ",(0,r.jsx)("code",{children:"d"}),". If ",(0,r.jsx)("code",{children:"d"})," is positive, the functions starts from the curve\u2019s start ",(0,r.jsx)("code",{children:"s"}),", if ",(0,r.jsx)("code",{children:"d"})," is negative, it starts form the curve\u2019s end ",(0,r.jsx)("code",{children:"e"}),"."]}),"\n",(0,r.jsx)(n,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Curve start"})}),"\n",(0,r.jsx)(n,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Curve end"})}),"\n",(0,r.jsx)(n,{name:"c1",types:"vector",children:(0,r.jsx)("p",{children:"Control point 1"})}),"\n",(0,r.jsx)(n,{name:"c2",types:"vector",children:(0,r.jsx)("p",{children:"Control point 2"})}),"\n",(0,r.jsx)(n,{name:"d",types:"float",children:(0,r.jsxs)("p",{children:["The distance along the bezier to find ",(0,r.jsx)("code",{children:"t"}),"."]})})]})}function L(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(I,{...e})}):I(e)}function _(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function N(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||H("Function",!0),n||H("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"cubic-shorten",parameters:{s:{types:"vector"},e:{types:"vector"},c1:{types:"vector"},c2:{types:"vector"},d:{types:"float"},samples:{types:"int"}}}),"\n",(0,r.jsxs)("p",{children:["Shorten curve by distance ",(0,r.jsx)("code",{children:"d"}),". This keeps the curvature of the curve by finding new values along the original curve. If ",(0,r.jsx)("code",{children:"d"})," is positive the curve gets shortened by moving ",(0,r.jsx)("code",{children:"s"})," closer to ",(0,r.jsx)("code",{children:"e"}),", if ",(0,r.jsx)("code",{children:"d"})," is negative, ",(0,r.jsx)("code",{children:"e"})," is moved closer to ",(0,r.jsx)("code",{children:"s"}),". The points ",(0,r.jsx)("code",{children:"s"})," and ",(0,r.jsx)("code",{children:"e"})," are moved along the curve, keeping the curve\u2019s curvature the same (the control points get recalculated)."]}),"\n",(0,r.jsx)(n,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Curve start"})}),"\n",(0,r.jsx)(n,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Curve end"})}),"\n",(0,r.jsx)(n,{name:"c1",types:"vector",children:(0,r.jsx)("p",{children:"Control point 1"})}),"\n",(0,r.jsx)(n,{name:"c2",types:"vector",children:(0,r.jsx)("p",{children:"Control point 2"})}),"\n",(0,r.jsx)(n,{name:"d",types:"float",children:(0,r.jsx)("p",{children:"Distance to shorten by"})}),"\n",(0,r.jsx)(n,{name:"samples",types:"int",children:(0,r.jsx)("p",{children:"Maximum of samples/steps to use"})})]})}function U(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(N,{...e})}):N(e)}function H(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function J(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||O("Function",!0),n||O("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"cubic-extrema",parameters:{s:{types:"vector"},e:{types:"vector"},c1:{types:"vector"},c2:{types:"vector"}}}),"\n",(0,r.jsx)("p",{children:"Find cubic curve extrema by calculating the roots of the curve\u2019s first derivative. Returns an array</Type> of vector</Type> ordered by distance along the curve from the start to its end."}),"\n",(0,r.jsx)(n,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Curve start"})}),"\n",(0,r.jsx)(n,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Curve end"})}),"\n",(0,r.jsx)(n,{name:"c1",types:"vector",children:(0,r.jsx)("p",{children:"Control point 1"})}),"\n",(0,r.jsx)(n,{name:"c2",types:"vector",children:(0,r.jsx)("p",{children:"Control point 2"})})]})}function K(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(J,{...e})}):J(e)}function O(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function Q(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||W("Function",!0),n||W("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"cubic-aabb",parameters:{s:{types:"vector"},e:{types:"vector"},c1:{types:"vector"},c2:{types:"vector"}}}
1),"\n",(0,r.jsxs)("p",{children:["Returns axis aligned bounding box coordinates ",(0,r.jsx)("code",{children:"(bottom-left, top-right)"})," for a cubic bezier curve."]}),"\n",(0,r.jsx)(n,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Curve start"})}),"\n",(0,r.jsx)(n,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Curve end"})}),"\n",(0,r.jsx)(n,{name:"c1",types:"vector",children:(0,r.jsx)("p",{children:"Control point 1"})}),"\n",(0,r.jsx)(n,{name:"c2",types:"vector",children:(0,r.jsx)("p",{children:"Control point 2"})})]})}function V(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(Q,{...e})}):Q(e)}function W(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function X(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||Z("Function",!0),n||Z("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"catmull-to-cubic",parameters:{points:{types:"array"},k:{types:"float"},close:{types:"bool"}}}),"\n",(0,r.jsx)("p",{children:"Returns an array of cubic bezier</Type> for a catmull curve through an array of points."}),"\n",(0,r.jsx)(n,{name:"points",types:"array",children:(0,r.jsx)("p",{children:"Array of 2d points"})}),"\n",(0,r.jsx)(n,{name:"k",types:"float",children:(0,r.jsx)("p",{children:"Strength between 0 and 1"})}),"\n",(0,r.jsx)(n,{name:"close",types:"bool"})]})}function Y(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(X,{...e})}):X(e)}function Z(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function $(e){const{Function:t,Parameter:n}={...(0,o.R)(),...e.components};return t||te("Function",!0),n||te("Parameter",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t,{name:"line-cubic-intersections",parameters:{s:{types:"vector"},e:{types:"vector"},c1:{types:"vector"},c2:{types:"vector"},la:{types:"vector"},lb:{types:"vector"},ray:{types:"bool"}}}),"\n",(0,r.jsx)("p",{children:"Calculate the intersection points between a 2D cubic-bezier and a straight line. Returns an array of vector</Type>"}),"\n",(0,r.jsx)(n,{name:"s",types:"vector",children:(0,r.jsx)("p",{children:"Bezier start point"})}),"\n",(0,r.jsx)(n,{name:"e",types:"vector",children:(0,r.jsx)("p",{children:"Bezier end point"})}),"\n",(0,r.jsx)(n,{name:"c1",types:"vector",children:(0,r.jsx)("p",{children:"Bezier control point 1"})}),"\n",(0,r.jsx)(n,{name:"c2",types:"vector",children:(0,r.jsx)("p",{children:"Bezier control point 2"})}),"\n",(0,r.jsx)(n,{name:"la",types:"vector",children:(0,r.jsx)("p",{children:"Line start point"})}),"\n",(0,r.jsx)(n,{name:"lb",types:"vector",children:(0,r.jsx)("p",{children:"Line end point"})}),"\n",(0,r.jsx)(n,{name:"ray",types:"bool",children:(0,r.jsx)("p",{children:"If set to true, ignore line length"})})]})}function ee(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)($,{...e})}):$(e)}function te(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}function ne(e){const t={h2:"h2",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h2,{id:"quadratic-point",children:"quadratic-point"}),"\n",(0,r.jsx)(i,{}),"\n",(0,r.jsx)(t.h2,{id:"quadratic-derivative",children:"quadratic-derivative"}),"\n",(0,r.jsx)(p,{}),"\n",(0,r.jsx)(t.h2,{id:"cubic-point",children:"cubic-point"}),"\n",(0,r.jsx)(h,{}),"\n",(0,r.jsx)(t.h2,{id:"cubic-derivative",children:"cubic-derivative"}),"\n",(0,r.jsx)(j,{}),"\n",(0,r.jsx)(t.h2,{id:"to-abc",children:"to-abc"}),"\n",(0,r.jsx)(y,{}),"\n",(0,r.jsx)(t.h2,{id:"quadratic-through-3points",children:"quadratic-through-3points"}),"\n",(0,r.jsx)(g,{}),"\n",(0,r.jsx)(t.h2,{id:"quadratic-to-cubic",children:"quadratic-to-cubic"}),"\n",(0,r.jsx)(F,{}),"\n",(0,r.jsx)(t.h2,{id:"cubic-through-3points",children:"cubic-through-3points"}),"\n",(0,r.jsx)(z,{}),"\n",(0,r.jsx)(t.h2,{id:"split",children:"split"}),"\n",(0,r.jsx)(q,{}),"\n",(0,r.jsx)(t.h2,{id:"cubic-arclen",children:"cubic-arclen"}),"\n",(0,r.jsx)(A,{}),"\n",(0,r.jsx)(t.h2,{id:"cubic-shorten-linear",children:"cubic-shorten-linear"}),"\n",(0,r.jsx)(M,{}),"\n",(0,r.jsx)(t.h2,{id:"cubic-t-for-distance",children:"cubic-t-for-distance"}),"\n",(0,r.jsx)(L,{}),"\n",(0,r.jsx)(t.h2,{id:"cubic-shorten",children:"cubic-shorten"}),"\n",(0,r.jsx)(U,{}),"\n",(0,r.jsx)(t.h2,{id:"cubic-extrema",children:"cubic-extrema"}),"\n",(0,r.jsx)(K,{}),"\n",(0,r.jsx)(t.h2,{id:"cubic-aabb",children:"cubic-aabb"}),"\n",(0,r.jsx)(V,{}),"\n",(0,r.jsx)(t.h2,{id:"catmull-to-cubic",children:"catmull-to-cubic"}),"\n",(0,r.jsx)(Y,{}),"\n",(0,r.jsx)(t.h2,{id:"line-cubic-intersections",children:"line-cubic-intersections"}),"\n",(0,r.jsx)(ee,{})]})}function re(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(ne,{...e})}):ne(e)}const oe={title:"Bezier"},ce="bezier",ie={id:"api/internal/bezier",title:"Bezier",description:"An array of three or four vectors, the start point, the endpoint, the first control point and optionally a second control point if the bezier is cubic.",source:"@site/cetz/docs/api/internal/bezier.mdx",sourceDirName:"api/internal",slug:"/api/internal/bezier",permalink:"/docs/api/internal/bezier",draft:!1,unlisted:!1,editUrl:"https://github.com/cetz-package/docs/blob/main/cetz/docs/api/internal/bezier.mdx",tags:[],version:"current",frontMatter:{title:"Bezier"},sidebar:"api",previous:{title:"Matrix",permalink:"/docs/api/internal/matrix"},next:{title:"Aabb",permalink:"/docs/api/internal/aabb"}},se={},ae=[...[{value:"quadratic-point",id:"quadratic-point",level:2},{value:"quadratic-derivative",id:"quadratic-derivative",level:2},{value:"cubic-point",id:"cubic-point",level:2},{value:"cubic-derivative",id:"cubic-derivative",level:2},{value:"to-abc",id:"to-abc",level:2},{value:"quadratic-through-3points",id:"quadratic-through-3points",level:2},{value:"quadratic-to-cubic",id:"quadratic-to-cubic",level:2},{value:"cubic-through-3points",id:"cubic-through-3points",level:2},{value:"split",id:"split",level:2},{value:"cubic-arclen",id:"cubic-arclen",level:2},{value:"cubic-shorten-linear",id:"cubic-shorten-linear",level:2},{value:"cubic-t-for-distance",id:"cubic-t-for-distance",level:2},{value:"cubic-shorten",id:"cubic-shorten",level:2}
1,{value:"cubic-extrema",id:"cubic-extrema",level:2},{value:"cubic-aabb",id:"cubic-aabb",level:2},{value:"catmull-to-cubic",id:"catmull-to-cubic",level:2},{value:"line-cubic-intersections",id:"line-cubic-intersections",level:2}]];function pe(e){const t={code:"code",h1:"h1",header:"header",p:"p",...(0,o.R)(),...e.components},{Type:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Type",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"bezier",children:(0,r.jsx)(n,{children:"bezier"})})}),"\n",(0,r.jsxs)(t.p,{children:["An ",(0,r.jsx)(n,{children:"array"})," of three or four ",(0,r.jsx)(n,{children:"vector"}),"s, the start point, the endpoint, the first control point and optionally a second control point if the bezier is cubic."]}),"\n",(0,r.jsxs)(t.p,{children:["The following functions are in the ",(0,r.jsx)(t.code,{children:"bezier"})," module."]}),"\n","\n",(0,r.jsx)(re,{})]})}function de(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(pe,{...e})}):pe(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>s});var r=n(6540);const o={},c=r.createContext(o);function i(e){const t=r.useContext(c);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),r.createElement(c.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.