This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use kurbo::{CubicBez, ParamCurveDeriv}; | |
| /// Compute bounds on curvature | |
| pub fn kbound(c: CubicBez) -> (f64, f64) { | |
| let q = c.deriv(); | |
| let p1xp0 = q.p1.to_vec2().cross(q.p0.to_vec2()); | |
| let p2xp0 = q.p2.to_vec2().cross(q.p0.to_vec2()); | |
| let p2xp1 = q.p2.to_vec2().cross(q.p1.to_vec2()); | |
| let c0 = 2. * p1xp0; | |
| let c1 = 2. * (p2xp0 - 2.0 * p1xp0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |