├── .eslintrc.cjs ├── .gitattributes ├── .gitignore ├── .mocharc.cjs ├── .quokka ├── README.md ├── browser ├── index.js ├── index.min.js └── index.min.js.LICENSE.txt ├── d.bat ├── docs ├── .nojekyll ├── 404.html ├── assets │ ├── css │ │ └── styles.cf14a825.css │ └── js │ │ ├── 013bcf01.c9a9ffe3.js │ │ ├── 013bcf01.eb96e264.js │ │ ├── 03130a88.0f49747f.js │ │ ├── 03130a88.d4c2b0db.js │ │ ├── 06b5d8c4.1f088769.js │ │ ├── 06b5d8c4.4f8ac05c.js │ │ ├── 07d0b887.b5da5484.js │ │ ├── 136fa1a6.cf6c0197.js │ │ ├── 13a60354.b5122fe3.js │ │ ├── 148e61be.57213444.js │ │ ├── 14af1335.e048aecb.js │ │ ├── 14af1335.e37423f3.js │ │ ├── 14fd291a.9bcafbdc.js │ │ ├── 14fd291a.ad3e8caf.js │ │ ├── 17896441.9dc49e14.js │ │ ├── 191e36d4.44063c88.js │ │ ├── 191e36d4.4a7ac965.js │ │ ├── 19303af3.1815b56f.js │ │ ├── 19303af3.5ce19aa0.js │ │ ├── 1be78505.92bcec6b.js │ │ ├── 1f391b9e.c2e29a5a.js │ │ ├── 23374ca6.a2555050.js │ │ ├── 247c60f8.3cc84323.js │ │ ├── 2520f72c.0fd40951.js │ │ ├── 2520f72c.96d9444b.js │ │ ├── 28133b20.7b1ae6a0.js │ │ ├── 28133b20.daa51d4e.js │ │ ├── 28cdeef8.b39767c3.js │ │ ├── 290a34ee.0c21b556.js │ │ ├── 290a34ee.b1af5c2e.js │ │ ├── 2b4c812b.28afe5a5.js │ │ ├── 2b4c812b.9900a1e9.js │ │ ├── 2cbb4737.87c6dcf6.js │ │ ├── 2cbb4737.e5a8f6bb.js │ │ ├── 2f928547.174c0f2c.js │ │ ├── 2f928547.e080f827.js │ │ ├── 32c9a411.730983aa.js │ │ ├── 345ea93c.2ac58d4b.js │ │ ├── 35da1204.ac097163.js │ │ ├── 35da1204.c290d0cc.js │ │ ├── 393be207.7b416056.js │ │ ├── 3b3c1dcf.768bbf64.js │ │ ├── 3b3c1dcf.b37dcd24.js │ │ ├── 3c7948d1.892bbdb4.js │ │ ├── 3c7948d1.8bfecbf4.js │ │ ├── 3dc76a04.0c4f328a.js │ │ ├── 3dc76a04.3849c704.js │ │ ├── 3e08a94f.823665fe.js │ │ ├── 3e08a94f.d351435d.js │ │ ├── 3e0cdfe5.13c7f26c.js │ │ ├── 3e0cdfe5.d70111d4.js │ │ ├── 408c0ad0.6bbbb20d.js │ │ ├── 408c0ad0.d98b3a1f.js │ │ ├── 4128851a.e0e3fe36.js │ │ ├── 42ad98e7.c801ae4c.js │ │ ├── 42ad98e7.f2a6d0bd.js │ │ ├── 42be3edb.8acd014f.js │ │ ├── 42be3edb.8d15fbe2.js │ │ ├── 445d85d7.50c4c84f.js │ │ ├── 445d85d7.b2793ba9.js │ │ ├── 4608.36f59fc0.js │ │ ├── 4791421d.ea814b83.js │ │ ├── 4791421d.fb9e4583.js │ │ ├── 47a5e3a8.fc82e4bb.js │ │ ├── 49f40481.6b1bb4c9.js │ │ ├── 49f40481.de1b0de9.js │ │ ├── 4ac86185.46920b42.js │ │ ├── 4ac86185.a92ea2f4.js │ │ ├── 4c8d2253.82983814.js │ │ ├── 4c8d2253.b012728b.js │ │ ├── 4de664d4.71b9fe75.js │ │ ├── 4de664d4.8ab9658f.js │ │ ├── 5062.18b05940.js │ │ ├── 512d1907.83ed242a.js │ │ ├── 512d1907.bc1ae362.js │ │ ├── 5145b32c.781102a1.js │ │ ├── 5145b32c.f6f52a6a.js │ │ ├── 52a1f108.3aa2f373.js │ │ ├── 52a1f108.65ff850a.js │ │ ├── 547d486b.d5a6900f.js │ │ ├── 547d486b.e7c92e43.js │ │ ├── 5565b1f8.ea6b9ee5.js │ │ ├── 55cd3763.61738c78.js │ │ ├── 55cd3763.8f92261b.js │ │ ├── 55d5f364.9ecd2aaf.js │ │ ├── 55d5f364.e9ae3d44.js │ │ ├── 56e024f2.8c24f122.js │ │ ├── 57d4edd0.818bb58f.js │ │ ├── 57d4edd0.ae3a4640.js │ │ ├── 5c5dacbc.e7adcced.js │ │ ├── 5df3dba5.51893706.js │ │ ├── 5df3dba5.b2860d9b.js │ │ ├── 5f805ca3.58b67d22.js │ │ ├── 618f5058.28951b5a.js │ │ ├── 618f5058.abfd14d1.js │ │ ├── 61f25e35.9a2641db.js │ │ ├── 61f25e35.ca1c9375.js │ │ ├── 6727e51b.6c1aef98.js │ │ ├── 6727e51b.a5806ca8.js │ │ ├── 69348500.7da064f8.js │ │ ├── 6953a901.18c607f9.js │ │ ├── 6953a901.5c1a7df9.js │ │ ├── 6d709919.6f78822f.js │ │ ├── 6e6849fa.22c69e85.js │ │ ├── 6e6849fa.2d197f59.js │ │ ├── 6e8414da.8ee6f5a1.js │ │ ├── 6e8414da.97c61ee7.js │ │ ├── 6f8a8b43.33834815.js │ │ ├── 759a04e9.05509875.js │ │ ├── 759a04e9.e86c8566.js │ │ ├── 75b96948.6b46992f.js │ │ ├── 7911588d.c50c3a50.js │ │ ├── 7ae479fe.66231786.js │ │ ├── 7b8919f9.11680353.js │ │ ├── 7b8919f9.452c47fc.js │ │ ├── 7c5abe58.07259565.js │ │ ├── 7f3b248f.45673a24.js │ │ ├── 7f3b248f.9628a2ff.js │ │ ├── 7f92ef49.b42e2189.js │ │ ├── 7f92ef49.e5ba8073.js │ │ ├── 884cf1fd.0c11f706.js │ │ ├── 884cf1fd.1c30a7a1.js │ │ ├── 889097ef.9354e790.js │ │ ├── 908cb160.404c53e1.js │ │ ├── 908cb160.bd758feb.js │ │ ├── 935f2afb.8c337b5b.js │ │ ├── 9397ae2d.135954b9.js │ │ ├── 9397ae2d.c16f5f7a.js │ │ ├── 946cd9a1.252f81a3.js │ │ ├── 9638ca63.53f622b6.js │ │ ├── 9996ffbe.4ab4fdea.js │ │ ├── 9996ffbe.d06c8002.js │ │ ├── 9bd66b52.4fc9286a.js │ │ ├── 9bd66b52.8a74b013.js │ │ ├── 9ca63887.072fd6bb.js │ │ ├── 9ca63887.f29489a5.js │ │ ├── 9d3c0d32.a88e5fd3.js │ │ ├── 9d3c0d32.ccea0c5e.js │ │ ├── 9f6a98b1.05f245a2.js │ │ ├── a2ea0035.3c7990b4.js │ │ ├── a32e1825.af50f0d8.js │ │ ├── a3cba1cf.0b5fd1c9.js │ │ ├── a3cba1cf.6a670bc0.js │ │ ├── a4b05d29.ecf11b68.js │ │ ├── a5d5f24a.876885c3.js │ │ ├── a5d5f24a.9d2ff81a.js │ │ ├── a7df0969.320bfafe.js │ │ ├── abe61dbb.cc7bc57c.js │ │ ├── b3883523.eb6f82ff.js │ │ ├── b89e22e9.63b6c10f.js │ │ ├── b99b386c.fc1c5d1a.js │ │ ├── b9a95153.a7846141.js │ │ ├── bd1a5869.7cf57c9e.js │ │ ├── bf94e0c7.14de9fb9.js │ │ ├── bf94e0c7.f7afd7e4.js │ │ ├── c4f5d8e4.b688354b.js │ │ ├── c856b7df.117b2d1b.js │ │ ├── c856b7df.4ce00c2d.js │ │ ├── caa70c58.acd6f12f.js │ │ ├── cbcaf1e9.3912febd.js │ │ ├── cbcaf1e9.eddc3ce4.js │ │ ├── cc381fa2.4f8771f9.js │ │ ├── cc381fa2.b0f2ab21.js │ │ ├── common.5b15f567.js │ │ ├── d49e353c.4f823bfd.js │ │ ├── d49e353c.5951aed8.js │ │ ├── d5bb289f.90d2e702.js │ │ ├── d6176c4d.5074a358.js │ │ ├── d6176c4d.5f4f52de.js │ │ ├── d64dc255.11f38912.js │ │ ├── d64dc255.287bf2a5.js │ │ ├── d9f86a67.3a2fd7f5.js │ │ ├── d9f86a67.4e8d6b70.js │ │ ├── e475ef2f.441a3dbb.js │ │ ├── e475ef2f.7b8ba18c.js │ │ ├── e5176a1b.b6a9d5fe.js │ │ ├── e5176a1b.fe35c968.js │ │ ├── e5360207.39bb2cdb.js │ │ ├── e5360207.ef1d4c75.js │ │ ├── ea2bdddd.185ce156.js │ │ ├── ea2bdddd.600c92fe.js │ │ ├── eb06e5c6.ac71452e.js │ │ ├── eb06e5c6.fdaea5f3.js │ │ ├── ebfade8c.731cb371.js │ │ ├── ebfade8c.cc61f22e.js │ │ ├── ed3615b6.626da005.js │ │ ├── ed3615b6.ba4e7f6f.js │ │ ├── edb9db6a.2f634c02.js │ │ ├── edb9db6a.ca0476f0.js │ │ ├── f0c2a7b1.e97b78af.js │ │ ├── f0c2a7b1.f8684452.js │ │ ├── f1cf2caf.ba2b4172.js │ │ ├── f1cf2caf.bb3a17f1.js │ │ ├── f2b248b2.3c567d2b.js │ │ ├── f2b248b2.ba504ecd.js │ │ ├── f35676b8.440c2603.js │ │ ├── f35676b8.f6156903.js │ │ ├── f477b378.09635c69.js │ │ ├── f8b2b675.8c293981.js │ │ ├── fac2f5ab.9891acca.js │ │ ├── fac2f5ab.e0bdd5f6.js │ │ ├── fc637c3a.166d6cda.js │ │ ├── fc637c3a.d05dee35.js │ │ ├── ff06bafa.068bddd5.js │ │ ├── ff06bafa.ba5dae70.js │ │ ├── main.b92d45cc.js │ │ ├── main.b92d45cc.js.LICENSE.txt │ │ ├── runtime~main.06fcdd98.js │ │ └── runtime~main.3d48f2e0.js ├── docs │ ├── index.html │ └── modules │ │ ├── boxes_are_boxes_intersecting │ │ └── index.html │ │ ├── boxes_intersect_boxes │ │ └── index.html │ │ ├── create_cubic_through_point_given013 │ │ └── index.html │ │ ├── create_generate_cusp_at_half_t │ │ └── index.html │ │ ├── create_generate_quarter_circle │ │ └── index.html │ │ ├── create_generate_self_intersecting │ │ └── index.html │ │ ├── fit_fit_quads_to_cubic │ │ └── index.html │ │ ├── fit_get_abs_area_between │ │ └── index.html │ │ ├── fit_quadratic_to_polyline │ │ └── index.html │ │ ├── from_power_basis_from_power_basis │ │ └── index.html │ │ ├── get_curvature_extrema_get_curvature_extrema │ │ └── index.html │ │ ├── global_properties_bounds_get_bounding_box │ │ └── index.html │ │ ├── global_properties_bounds_get_bounding_box_tight │ │ └── index.html │ │ ├── global_properties_bounds_get_bounds │ │ └── index.html │ │ ├── global_properties_bounds_get_control_point_box │ │ └── index.html │ │ ├── global_properties_bounds_get_interval_box_get_interval_box │ │ └── index.html │ │ ├── global_properties_bounds_get_interval_box_get_interval_box_dd │ │ └── index.html │ │ ├── global_properties_bounds_get_x_bounds_tight │ │ └── index.html │ │ ├── global_properties_bounds_get_y_bounds_tight │ │ └── index.html │ │ ├── global_properties_classification_classify │ │ └── index.html │ │ ├── global_properties_classification_is_collinear │ │ └── index.html │ │ ├── global_properties_classification_is_cubic_really_line │ │ └── index.html │ │ ├── global_properties_classification_is_cubic_really_quad │ │ └── index.html │ │ ├── global_properties_classification_is_quad_obtuse │ │ └── index.html │ │ ├── global_properties_classification_is_quad_really_line │ │ └── index.html │ │ ├── global_properties_classification_is_really_point │ │ └── index.html │ │ ├── global_properties_classification_is_self_overlapping │ │ └── index.html │ │ ├── global_properties_curviness │ │ └── index.html │ │ ├── global_properties_get_inflections │ │ └── index.html │ │ ├── global_properties_length_control_point_lines_length │ │ └── index.html │ │ ├── global_properties_length_length │ │ └── index.html │ │ ├── global_properties_length_total_length │ │ └── index.html │ │ ├── global_properties_total_absolute_curvature │ │ └── index.html │ │ ├── implicit_form_double_double_get_implicit_form1_dd │ │ └── index.html │ │ ├── implicit_form_double_double_get_implicit_form1_dd_with_running_error │ │ └── index.html │ │ ├── implicit_form_double_double_get_implicit_form2_dd │ │ └── index.html │ │ ├── implicit_form_double_double_get_implicit_form2_dd_with_running_error │ │ └── index.html │ │ ├── implicit_form_double_double_get_implicit_form3_dd │ │ └── index.html │ │ ├── implicit_form_double_double_get_implicit_form3_dd_with_running_error │ │ └── index.html │ │ ├── implicit_form_double_get_implicit_form1 │ │ └── index.html │ │ ├── implicit_form_double_get_implicit_form2 │ │ └── index.html │ │ ├── implicit_form_double_get_implicit_form3 │ │ └── index.html │ │ ├── implicit_form_evaluate_double_evaluate_implicit1 │ │ └── index.html │ │ ├── implicit_form_evaluate_double_evaluate_implicit2 │ │ └── index.html │ │ ├── implicit_form_evaluate_double_evaluate_implicit3 │ │ └── index.html │ │ ├── implicit_form_exact_get_implicit_form1_exact │ │ └── index.html │ │ ├── implicit_form_exact_get_implicit_form2_exact │ │ └── index.html │ │ ├── implicit_form_exact_get_implicit_form3_exact │ │ └── index.html │ │ ├── implicit_form_get_error_counters_get_implicit_form1_error_counters │ │ └── index.html │ │ ├── implicit_form_get_error_counters_get_implicit_form2_error_counters │ │ └── index.html │ │ ├── implicit_form_get_error_counters_get_implicit_form3_error_counters │ │ └── index.html │ │ ├── intersection_bezier_bezier_intersection_bezier_bezier_intersection │ │ └── index.html │ │ ├── intersection_bezier_bezier_intersection_fast_bezier_bezier_intersection_fast │ │ └── index.html │ │ ├── intersection_bezier_bezier_intersection_get_coefficients_get_coeffs_bez_bez │ │ └── index.html │ │ ├── intersection_circle_bezier_intersection_circle_bezier_intersection │ │ └── index.html │ │ ├── intersection_self_intersection_bezier_self_intersection │ │ └── index.html │ │ ├── local_properties_at_t_curvature │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_2nd_derivative_double_evaluate_2nd_derivative │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_2nd_derivative_double_evaluate_2nd_derivative_at_0 │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_2nd_derivative_double_evaluate_2nd_derivative_at_1 │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_2nd_derivative_exact_evaluate_2nd_derivative_at_0_exact │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_2nd_derivative_exact_evaluate_2nd_derivative_at_1_exact │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_2nd_derivative_exact_evaluate_2nd_derivative_exact │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_double_double_eval_de_casteljau_dd │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_double_double_eval_de_casteljau_with_err_dd │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_double_eval_de_casteljau │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_double_eval_de_casteljau_with_err │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_double_evaluate │ │ └── index.html │ │ ├── local_properties_at_t_evaluate_exact_evaluate_exact │ │ └── index.html │ │ ├── local_properties_at_t_normal_normal │ │ └── index.html │ │ ├── local_properties_at_t_tangent_double_tangent │ │ └── index.html │ │ ├── local_properties_at_t_tangent_double_tangent_at_0 │ │ └── index.html │ │ ├── local_properties_at_t_tangent_double_tangent_at_1 │ │ └── index.html │ │ ├── local_properties_at_t_tangent_exact_tangent_at_0_exact │ │ └── index.html │ │ ├── local_properties_at_t_tangent_exact_tangent_at_1_exact │ │ └── index.html │ │ ├── local_properties_at_t_tangent_exact_tangent_exact │ │ └── index.html │ │ ├── local_properties_to_t_get_t_at_length │ │ └── index.html │ │ ├── simultaneous_properties_closest_and_furthest_point_on_bezier_closest_point_on_bezier │ │ └── index.html │ │ ├── simultaneous_properties_closest_and_furthest_point_on_bezier_closest_point_on_bezier_certified │ │ └── index.html │ │ ├── simultaneous_properties_closest_and_furthest_point_on_bezier_furthest_point_on_bezier │ │ └── index.html │ │ ├── simultaneous_properties_equal │ │ └── index.html │ │ ├── simultaneous_properties_hausdorff_distance_hausdorff_distance │ │ └── index.html │ │ ├── simultaneous_properties_hausdorff_distance_hausdorff_distance_one_sided │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_1st_derivative_double_double_to_power_basis_1st_derivative_dd │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_1st_derivative_double_to_power_basis_1st_derivative │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_1st_derivative_exact_to_power_basis_1st_derivative_exact │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_1st_derivative_to_power_basis_1st_derivative_error_counters │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_2nd_derivative_double_double_to_power_basis_2nd_derivative_dd │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_2nd_derivative_double_to_power_basis_2nd_derivative │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_2nd_derivative_exact_to_power_basis_2nd_derivative_exact │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_3rd_derivative_double_double_to_power_basis_3rd_derivative_dd │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_3rd_derivative_double_to_power_basis_3rd_derivative │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_3rd_derivative_exact_to_power_basis_3rd_derivative_exact │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_double_double_to_power_basis_dd │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_double_double_to_power_basis_dd_with_running_error │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_double_to_power_basis │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_double_to_power_basis_with_running_error │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_exact_to_power_basis_exact │ │ └── index.html │ │ ├── to_power_basis_to_power_basis_to_power_basis_error_counters │ │ └── index.html │ │ ├── transformation_clone │ │ └── index.html │ │ ├── transformation_degree_or_type_cubic_to_hybrid_quadratic │ │ └── index.html │ │ ├── transformation_degree_or_type_cubic_to_quadratic │ │ └── index.html │ │ ├── transformation_degree_or_type_line_to_cubic │ │ └── index.html │ │ ├── transformation_degree_or_type_line_to_quadratic │ │ └── index.html │ │ ├── transformation_degree_or_type_quadratic_to_cubic │ │ └── index.html │ │ ├── transformation_degree_or_type_to_cubic │ │ └── index.html │ │ ├── transformation_get_hodograph │ │ └── index.html │ │ ├── transformation_reduce_order_if_possible │ │ └── index.html │ │ ├── transformation_reverse │ │ └── index.html │ │ ├── transformation_split_from_to │ │ └── index.html │ │ ├── transformation_split_from_to_incl_error_bound │ │ └── index.html │ │ ├── transformation_split_split_by_curvature │ │ └── index.html │ │ ├── transformation_split_split_by_curvature_and_length │ │ └── index.html │ │ ├── transformation_split_split_by_length │ │ └── index.html │ │ └── transformation_to_string │ │ └── index.html ├── img │ ├── docusaurus.png │ ├── favicon.ico │ ├── logo.png │ ├── logo.svg │ ├── undraw_accurate.svg │ ├── undraw_fast.svg │ ├── undraw_freestanding.svg │ ├── undraw_pure.svg │ ├── undraw_robust.svg │ └── undraw_tested.svg ├── index.html ├── markdown-page │ └── index.html └── sitemap.xml ├── node ├── add-1-ulp.d.ts ├── add-1-ulp.js ├── add-1-ulp.js.map ├── angles-and-speeds │ ├── angles-and-speeds.d.ts │ ├── angles-and-speeds.js │ ├── angles-and-speeds.js.map │ └── bezier-by-angles-and-speeds │ │ ├── angles-and-speeds.d.ts │ │ ├── angles-and-speeds.js │ │ ├── angles-and-speeds.js.map │ │ ├── cubic-from-angles-and-speeds.d.ts │ │ ├── cubic-from-angles-and-speeds.js │ │ ├── cubic-from-angles-and-speeds.js.map │ │ ├── cubic-to-angles-and-speeds.d.ts │ │ ├── cubic-to-angles-and-speeds.js │ │ ├── cubic-to-angles-and-speeds.js.map │ │ ├── get-cubic-speeds.d.ts │ │ ├── get-cubic-speeds.js │ │ ├── get-cubic-speeds.js.map │ │ ├── set-cubic-speeds.d.ts │ │ ├── set-cubic-speeds.js │ │ └── set-cubic-speeds.js.map ├── bezier-piece.d.ts ├── bezier-piece.js ├── bezier-piece.js.map ├── boxes │ ├── are-boxes-intersecting.d.ts │ ├── are-boxes-intersecting.js │ ├── are-boxes-intersecting.js.map │ ├── intersect-boxes.d.ts │ ├── intersect-boxes.js │ └── intersect-boxes.js.map ├── create │ ├── cubic-through-point-given013.d.ts │ ├── cubic-through-point-given013.js │ ├── cubic-through-point-given013.js.map │ ├── generate-cusp-at-half-t.d.ts │ ├── generate-cusp-at-half-t.js │ ├── generate-cusp-at-half-t.js.map │ ├── generate-quarter-circle.d.ts │ ├── generate-quarter-circle.js │ ├── generate-quarter-circle.js.map │ ├── generate-self-intersecting.d.ts │ ├── generate-self-intersecting.js │ └── generate-self-intersecting.js.map ├── error-analysis │ ├── error-analysis.d.ts │ ├── error-analysis.js │ ├── error-analysis.js.map │ ├── max-abs-coordinate.d.ts │ ├── max-abs-coordinate.js │ └── max-abs-coordinate.js.map ├── fit │ ├── fit-quads-to-cubic-hausdorff.d.ts │ ├── fit-quads-to-cubic-hausdorff.js │ ├── fit-quads-to-cubic-hausdorff.js.map │ ├── fit-quads-to-cubic.d.ts │ ├── fit-quads-to-cubic.js │ ├── fit-quads-to-cubic.js.map │ ├── get-abs-area-between.d.ts │ ├── get-abs-area-between.js │ ├── get-abs-area-between.js.map │ ├── quadratic-to-polyline.d.ts │ ├── quadratic-to-polyline.js │ └── quadratic-to-polyline.js.map ├── from-power-basis │ ├── from-power-basis.d.ts │ ├── from-power-basis.js │ └── from-power-basis.js.map ├── get-curvature-extrema-dd │ ├── get-abs-curvature-extrema-polys-dd.d.ts │ ├── get-abs-curvature-extrema-polys-dd.js │ ├── get-abs-curvature-extrema-polys-dd.js.map │ ├── get-curvature-extrema-dd.d.ts │ ├── get-curvature-extrema-dd.js │ ├── get-curvature-extrema-dd.js.map │ ├── get-curvature-extrema-quadratic-poly-dd.d.ts │ ├── get-curvature-extrema-quadratic-poly-dd.js │ └── get-curvature-extrema-quadratic-poly-dd.js.map ├── get-curvature-extrema-e │ ├── get-abs-curvature-extrema-polys-e.d.ts │ ├── get-abs-curvature-extrema-polys-e.js │ ├── get-abs-curvature-extrema-polys-e.js.map │ ├── get-curvature-extrema-e.d.ts │ ├── get-curvature-extrema-e.js │ ├── get-curvature-extrema-e.js.map │ ├── get-curvature-extrema-quadratic-poly-e.d.ts │ ├── get-curvature-extrema-quadratic-poly-e.js │ └── get-curvature-extrema-quadratic-poly-e.js.map ├── get-curvature-extrema │ ├── get-abs-curvature-extrema-polys.d.ts │ ├── get-abs-curvature-extrema-polys.js │ ├── get-abs-curvature-extrema-polys.js.map │ ├── get-curvature-extrema-quadratic-poly.d.ts │ ├── get-curvature-extrema-quadratic-poly.js │ ├── get-curvature-extrema-quadratic-poly.js.map │ ├── get-curvature-extrema.d.ts │ ├── get-curvature-extrema.js │ └── get-curvature-extrema.js.map ├── global-properties │ ├── area.d.ts │ ├── area.js │ ├── area.js.map │ ├── bounds │ │ ├── bounds.d.ts │ │ ├── bounds.js │ │ ├── bounds.js.map │ │ ├── get-bounding-box-tight.d.ts │ │ ├── get-bounding-box-tight.js │ │ ├── get-bounding-box-tight.js.map │ │ ├── get-bounding-box.d.ts │ │ ├── get-bounding-box.js │ │ ├── get-bounding-box.js.map │ │ ├── get-bounding-hull.d.ts │ │ ├── get-bounding-hull.js │ │ ├── get-bounding-hull.js.map │ │ ├── get-bounds.d.ts │ │ ├── get-bounds.js │ │ ├── get-bounds.js.map │ │ ├── get-control-point-box.d.ts │ │ ├── get-control-point-box.js │ │ ├── get-control-point-box.js.map │ │ ├── get-interval-box │ │ │ ├── get-interval-box-dd.d.ts │ │ │ ├── get-interval-box-dd.js │ │ │ ├── get-interval-box-dd.js.map │ │ │ ├── get-interval-box.d.ts │ │ │ ├── get-interval-box.js │ │ │ └── get-interval-box.js.map │ │ ├── get-x-bounds-tight.d.ts │ │ ├── get-x-bounds-tight.js │ │ ├── get-x-bounds-tight.js.map │ │ ├── get-y-bounds-tight.d.ts │ │ ├── get-y-bounds-tight.js │ │ └── get-y-bounds-tight.js.map │ ├── classification │ │ ├── classify.d.ts │ │ ├── classify.js │ │ ├── classify.js.map │ │ ├── is-collinear.d.ts │ │ ├── is-collinear.js │ │ ├── is-collinear.js.map │ │ ├── is-cubic-really-line.d.ts │ │ ├── is-cubic-really-line.js │ │ ├── is-cubic-really-line.js.map │ │ ├── is-cubic-really-quad.d.ts │ │ ├── is-cubic-really-quad.js │ │ ├── is-cubic-really-quad.js.map │ │ ├── is-quad-flat.d.ts │ │ ├── is-quad-flat.js │ │ ├── is-quad-flat.js.map │ │ ├── is-quad-obtuse.d.ts │ │ ├── is-quad-obtuse.js │ │ ├── is-quad-obtuse.js.map │ │ ├── is-quad-really-line.d.ts │ │ ├── is-quad-really-line.js │ │ ├── is-quad-really-line.js.map │ │ ├── is-really-point.d.ts │ │ ├── is-really-point.js │ │ ├── is-really-point.js.map │ │ ├── is-self-overlapping.d.ts │ │ ├── is-self-overlapping.js │ │ └── is-self-overlapping.js.map │ ├── curviness.d.ts │ ├── curviness.js │ ├── curviness.js.map │ ├── get-bending-energy.d.ts │ ├── get-bending-energy.js │ ├── get-bending-energy.js.map │ ├── get-inflections.d.ts │ ├── get-inflections.js │ ├── get-inflections.js.map │ ├── length │ │ ├── control-point-lines-length.d.ts │ │ ├── control-point-lines-length.js │ │ ├── control-point-lines-length.js.map │ │ ├── length-bez1.d.ts │ │ ├── length-bez1.js │ │ ├── length-bez1.js.map │ │ ├── length-bez2.d.ts │ │ ├── length-bez2.js │ │ ├── length-bez2.js.map │ │ ├── length-bez3.d.ts │ │ ├── length-bez3.js │ │ ├── length-bez3.js.map │ │ ├── length.d.ts │ │ ├── length.js │ │ ├── length.js.map │ │ ├── total-length.d.ts │ │ ├── total-length.js │ │ └── total-length.js.map │ ├── total-absolute-curvature.d.ts │ ├── total-absolute-curvature.js │ └── total-absolute-curvature.js.map ├── implicit-form │ ├── double-double │ │ ├── get-implicit-form1-dd-with-running-error.d.ts │ │ ├── get-implicit-form1-dd-with-running-error.js │ │ ├── get-implicit-form1-dd-with-running-error.js.map │ │ ├── get-implicit-form1-dd.d.ts │ │ ├── get-implicit-form1-dd.js │ │ ├── get-implicit-form1-dd.js.map │ │ ├── get-implicit-form2-dd-with-running-error.d.ts │ │ ├── get-implicit-form2-dd-with-running-error.js │ │ ├── get-implicit-form2-dd-with-running-error.js.map │ │ ├── get-implicit-form2-dd.d.ts │ │ ├── get-implicit-form2-dd.js │ │ ├── get-implicit-form2-dd.js.map │ │ ├── get-implicit-form3-dd-with-running-error.d.ts │ │ ├── get-implicit-form3-dd-with-running-error.js │ │ ├── get-implicit-form3-dd-with-running-error.js.map │ │ ├── get-implicit-form3-dd.d.ts │ │ ├── get-implicit-form3-dd.js │ │ └── get-implicit-form3-dd.js.map │ ├── double │ │ ├── get-implicit-form1.d.ts │ │ ├── get-implicit-form1.js │ │ ├── get-implicit-form1.js.map │ │ ├── get-implicit-form2.d.ts │ │ ├── get-implicit-form2.js │ │ ├── get-implicit-form2.js.map │ │ ├── get-implicit-form3.d.ts │ │ ├── get-implicit-form3.js │ │ └── get-implicit-form3.js.map │ ├── evaluate │ │ └── double │ │ │ ├── evaluate-implicit1.d.ts │ │ │ ├── evaluate-implicit1.js │ │ │ ├── evaluate-implicit1.js.map │ │ │ ├── evaluate-implicit2.d.ts │ │ │ ├── evaluate-implicit2.js │ │ │ ├── evaluate-implicit2.js.map │ │ │ ├── evaluate-implicit3.d.ts │ │ │ ├── evaluate-implicit3.js │ │ │ └── evaluate-implicit3.js.map │ ├── exact │ │ ├── get-implicit-form1-exact.d.ts │ │ ├── get-implicit-form1-exact.js │ │ ├── get-implicit-form1-exact.js.map │ │ ├── get-implicit-form2-exact.d.ts │ │ ├── get-implicit-form2-exact.js │ │ ├── get-implicit-form2-exact.js.map │ │ ├── get-implicit-form3-exact.d.ts │ │ ├── get-implicit-form3-exact.js │ │ └── get-implicit-form3-exact.js.map │ ├── get-error-counters │ │ ├── get-implicit-form1-error-counters.d.ts │ │ ├── get-implicit-form1-error-counters.js │ │ ├── get-implicit-form1-error-counters.js.map │ │ ├── get-implicit-form2-error-counters.d.ts │ │ ├── get-implicit-form2-error-counters.js │ │ ├── get-implicit-form2-error-counters.js.map │ │ ├── get-implicit-form3-error-counters.d.ts │ │ ├── get-implicit-form3-error-counters.js │ │ └── get-implicit-form3-error-counters.js.map │ ├── implicit-form-types.d.ts │ ├── implicit-form-types.js │ └── implicit-form-types.js.map ├── index.d.ts ├── index.js ├── index.js.map ├── intersection │ ├── bezier-bezier-intersection-fast │ │ ├── bezier-bezier-intersection-fast.d.ts │ │ ├── bezier-bezier-intersection-fast.js │ │ ├── bezier-bezier-intersection-fast.js.map │ │ ├── check-intersection-in-ranges.d.ts │ │ ├── check-intersection-in-ranges.js │ │ ├── check-intersection-in-ranges.js.map │ │ ├── clip │ │ │ ├── geo-clip.d.ts │ │ │ ├── geo-clip.js │ │ │ ├── geo-clip.js.map │ │ │ ├── to-hybrid-quadratic.d.ts │ │ │ ├── to-hybrid-quadratic.js │ │ │ └── to-hybrid-quadratic.js.map │ │ ├── debug.d.ts │ │ ├── debug.js │ │ ├── debug.js.map │ │ ├── get-distance-to-line-function.d.ts │ │ ├── get-distance-to-line-function.js │ │ ├── get-distance-to-line-function.js.map │ │ ├── iteration.d.ts │ │ ├── iteration.js │ │ └── iteration.js.map │ ├── bezier-bezier-intersection │ │ ├── bezier-bezier-intersection-boundless.d.ts │ │ ├── bezier-bezier-intersection-boundless.js │ │ ├── bezier-bezier-intersection-boundless.js.map │ │ ├── bezier-bezier-intersection.d.ts │ │ ├── bezier-bezier-intersection.js │ │ ├── bezier-bezier-intersection.js.map │ │ ├── get-coefficients │ │ │ ├── double-double │ │ │ │ ├── get-coeffs-bez1-bez1-dd.d.ts │ │ │ │ ├── get-coeffs-bez1-bez1-dd.js │ │ │ │ ├── get-coeffs-bez1-bez1-dd.js.map │ │ │ │ ├── get-coeffs-bez1-bez2-dd.d.ts │ │ │ │ ├── get-coeffs-bez1-bez2-dd.js │ │ │ │ ├── get-coeffs-bez1-bez2-dd.js.map │ │ │ │ ├── get-coeffs-bez1-bez3-dd.d.ts │ │ │ │ ├── get-coeffs-bez1-bez3-dd.js │ │ │ │ ├── get-coeffs-bez1-bez3-dd.js.map │ │ │ │ ├── get-coeffs-bez2-bez1-dd.d.ts │ │ │ │ ├── get-coeffs-bez2-bez1-dd.js │ │ │ │ ├── get-coeffs-bez2-bez1-dd.js.map │ │ │ │ ├── get-coeffs-bez2-bez2-dd.d.ts │ │ │ │ ├── get-coeffs-bez2-bez2-dd.js │ │ │ │ ├── get-coeffs-bez2-bez2-dd.js.map │ │ │ │ ├── get-coeffs-bez2-bez3-dd.d.ts │ │ │ │ ├── get-coeffs-bez2-bez3-dd.js │ │ │ │ ├── get-coeffs-bez2-bez3-dd.js.map │ │ │ │ ├── get-coeffs-bez3-bez1-dd.d.ts │ │ │ │ ├── get-coeffs-bez3-bez1-dd.js │ │ │ │ ├── get-coeffs-bez3-bez1-dd.js.map │ │ │ │ ├── get-coeffs-bez3-bez2-dd.d.ts │ │ │ │ ├── get-coeffs-bez3-bez2-dd.js │ │ │ │ ├── get-coeffs-bez3-bez2-dd.js.map │ │ │ │ ├── get-coeffs-bez3-bez3-dd.d.ts │ │ │ │ ├── get-coeffs-bez3-bez3-dd.js │ │ │ │ └── get-coeffs-bez3-bez3-dd.js.map │ │ │ ├── exact │ │ │ │ ├── get-coeffs-bez1-bez1-exact.d.ts │ │ │ │ ├── get-coeffs-bez1-bez1-exact.js │ │ │ │ ├── get-coeffs-bez1-bez1-exact.js.map │ │ │ │ ├── get-coeffs-bez1-bez2-exact.d.ts │ │ │ │ ├── get-coeffs-bez1-bez2-exact.js │ │ │ │ ├── get-coeffs-bez1-bez2-exact.js.map │ │ │ │ ├── get-coeffs-bez1-bez3-exact.d.ts │ │ │ │ ├── get-coeffs-bez1-bez3-exact.js │ │ │ │ ├── get-coeffs-bez1-bez3-exact.js.map │ │ │ │ ├── get-coeffs-bez2-bez1-exact.d.ts │ │ │ │ ├── get-coeffs-bez2-bez1-exact.js │ │ │ │ ├── get-coeffs-bez2-bez1-exact.js.map │ │ │ │ ├── get-coeffs-bez2-bez2-exact.d.ts │ │ │ │ ├── get-coeffs-bez2-bez2-exact.js │ │ │ │ ├── get-coeffs-bez2-bez2-exact.js.map │ │ │ │ ├── get-coeffs-bez2-bez3-exact.d.ts │ │ │ │ ├── get-coeffs-bez2-bez3-exact.js │ │ │ │ ├── get-coeffs-bez2-bez3-exact.js.map │ │ │ │ ├── get-coeffs-bez3-bez1-exact.d.ts │ │ │ │ ├── get-coeffs-bez3-bez1-exact.js │ │ │ │ ├── get-coeffs-bez3-bez1-exact.js.map │ │ │ │ ├── get-coeffs-bez3-bez2-exact.d.ts │ │ │ │ ├── get-coeffs-bez3-bez2-exact.js │ │ │ │ ├── get-coeffs-bez3-bez2-exact.js.map │ │ │ │ ├── get-coeffs-bez3-bez3-exact.d.ts │ │ │ │ ├── get-coeffs-bez3-bez3-exact.js │ │ │ │ └── get-coeffs-bez3-bez3-exact.js.map │ │ │ ├── get-coeffs-bez-bez.d.ts │ │ │ ├── get-coeffs-bez-bez.js │ │ │ └── get-coeffs-bez-bez.js.map │ │ ├── x.d.ts │ │ ├── x.js │ │ └── x.js.map │ ├── circle-bezier-intersection │ │ ├── circle-bezier-intersection.d.ts │ │ ├── circle-bezier-intersection.js │ │ ├── circle-bezier-intersection.js.map │ │ ├── double-double │ │ │ ├── get-coeffs-dd.d.ts │ │ │ ├── get-coeffs-dd.js │ │ │ └── get-coeffs-dd.js.map │ │ ├── exact │ │ │ ├── get-coeffs-exact.d.ts │ │ │ ├── get-coeffs-exact.js │ │ │ └── get-coeffs-exact.js.map │ │ ├── get-circle-bezier-intersection-error-counters.d.ts │ │ ├── get-circle-bezier-intersection-error-counters.js │ │ └── get-circle-bezier-intersection-error-counters.js.map │ ├── get-endpoint-intersections │ │ ├── b-abs.d.ts │ │ ├── b-abs.js │ │ ├── b-abs.js.map │ │ ├── b-cbrt.d.ts │ │ ├── b-cbrt.js │ │ ├── b-cbrt.js.map │ │ ├── b-sign.d.ts │ │ ├── b-sign.js │ │ ├── b-sign.js.map │ │ ├── b-sqrt.d.ts │ │ ├── b-sqrt.js │ │ ├── b-sqrt.js.map │ │ ├── bigint-to-expansion.d.ts │ │ ├── bigint-to-expansion.js │ │ ├── bigint-to-expansion.js.map │ │ ├── calc-exact-cube-root.d.ts │ │ ├── calc-exact-cube-root.js │ │ ├── calc-exact-cube-root.js.map │ │ ├── calc-exact-square-root.d.ts │ │ ├── calc-exact-square-root.js │ │ ├── calc-exact-square-root.js.map │ │ ├── ensure-range.d.ts │ │ ├── ensure-range.js │ │ ├── ensure-range.js.map │ │ ├── er-compare.d.ts │ │ ├── er-compare.js │ │ ├── er-compare.js.map │ │ ├── er-estimate.d.ts │ │ ├── er-estimate.js │ │ ├── er-estimate.js.map │ │ ├── er-sign.d.ts │ │ ├── er-sign.js │ │ ├── er-sign.js.map │ │ ├── get-ab.d.ts │ │ ├── get-ab.js │ │ ├── get-ab.js.map │ │ ├── get-ab1.d.ts │ │ ├── get-ab1.js │ │ ├── get-ab1.js.map │ │ ├── get-ab2.d.ts │ │ ├── get-ab2.js │ │ ├── get-ab2.js.map │ │ ├── get-ab3.d.ts │ │ ├── get-ab3.js │ │ ├── get-ab3.js.map │ │ ├── get-endpoint-intersections.d.ts │ │ ├── get-endpoint-intersections.js │ │ ├── get-endpoint-intersections.js.map │ │ ├── get-transform-1.d.ts │ │ ├── get-transform-1.js │ │ ├── get-transform-1.js.map │ │ ├── get-transform-2.d.ts │ │ ├── get-transform-2.js │ │ ├── get-transform-2.js.map │ │ ├── get-transform-3.d.ts │ │ ├── get-transform-3.js │ │ ├── get-transform-3.js.map │ │ ├── sum-bigints.d.ts │ │ ├── sum-bigints.js │ │ └── sum-bigints.js.map │ └── self-intersection │ │ ├── bezier-self-intersection.d.ts │ │ ├── bezier-self-intersection.js │ │ ├── bezier-self-intersection.js.map │ │ └── get-coefficients │ │ ├── double │ │ ├── get-coeffs-bez3-with-running-error.d.ts │ │ ├── get-coeffs-bez3-with-running-error.js │ │ └── get-coeffs-bez3-with-running-error.js.map │ │ └── exact │ │ ├── get-coeffs-bez3-exact.d.ts │ │ ├── get-coeffs-bez3-exact.js │ │ └── get-coeffs-bez3-exact.js.map ├── local-properties-at-t │ ├── curvature.d.ts │ ├── curvature.js │ ├── curvature.js.map │ ├── dd-curvature.d.ts │ ├── dd-curvature.js │ ├── dd-curvature.js.map │ ├── ds.d.ts │ ├── ds.js │ ├── ds.js.map │ ├── e-curvature.d.ts │ ├── e-curvature.js │ ├── e-curvature.js.map │ ├── evaluate-2nd-derivative │ │ ├── double │ │ │ ├── evaluate-2nd-derivative-at-0.d.ts │ │ │ ├── evaluate-2nd-derivative-at-0.js │ │ │ ├── evaluate-2nd-derivative-at-0.js.map │ │ │ ├── evaluate-2nd-derivative-at-1.d.ts │ │ │ ├── evaluate-2nd-derivative-at-1.js │ │ │ ├── evaluate-2nd-derivative-at-1.js.map │ │ │ ├── evaluate-2nd-derivative.d.ts │ │ │ ├── evaluate-2nd-derivative.js │ │ │ └── evaluate-2nd-derivative.js.map │ │ └── exact │ │ │ ├── evaluate-2nd-derivative-at-0-exact.d.ts │ │ │ ├── evaluate-2nd-derivative-at-0-exact.js │ │ │ ├── evaluate-2nd-derivative-at-0-exact.js.map │ │ │ ├── evaluate-2nd-derivative-at-1-exact.d.ts │ │ │ ├── evaluate-2nd-derivative-at-1-exact.js │ │ │ ├── evaluate-2nd-derivative-at-1-exact.js.map │ │ │ ├── evaluate-2nd-derivative-exact.d.ts │ │ │ ├── evaluate-2nd-derivative-exact.js │ │ │ └── evaluate-2nd-derivative-exact.js.map │ ├── evaluate │ │ ├── double-double │ │ │ ├── eval-de-casteljau-dd.d.ts │ │ │ ├── eval-de-casteljau-dd.js │ │ │ ├── eval-de-casteljau-dd.js.map │ │ │ ├── eval-de-casteljau-with-err-dd.d.ts │ │ │ ├── eval-de-casteljau-with-err-dd.js │ │ │ └── eval-de-casteljau-with-err-dd.js.map │ │ ├── double │ │ │ ├── eval-de-casteljau-with-err.d.ts │ │ │ ├── eval-de-casteljau-with-err.js │ │ │ ├── eval-de-casteljau-with-err.js.map │ │ │ ├── eval-de-casteljau.d.ts │ │ │ ├── eval-de-casteljau.js │ │ │ ├── eval-de-casteljau.js.map │ │ │ ├── evaluate.d.ts │ │ │ ├── evaluate.js │ │ │ └── evaluate.js.map │ │ ├── eval-de-casteljau-error.d.ts │ │ ├── eval-de-casteljau-error.js │ │ ├── eval-de-casteljau-error.js.map │ │ └── exact │ │ │ ├── evaluate-exact.d.ts │ │ │ ├── evaluate-exact.js │ │ │ └── evaluate-exact.js.map │ ├── normal │ │ ├── normal.d.ts │ │ ├── normal.js │ │ ├── normal.js.map │ │ ├── normal2.d.ts │ │ ├── normal2.js │ │ └── normal2.js.map │ └── tangent │ │ ├── double │ │ ├── tangent-at-0.d.ts │ │ ├── tangent-at-0.js │ │ ├── tangent-at-0.js.map │ │ ├── tangent-at-1.d.ts │ │ ├── tangent-at-1.js │ │ ├── tangent-at-1.js.map │ │ ├── tangent.d.ts │ │ ├── tangent.js │ │ └── tangent.js.map │ │ └── exact │ │ ├── tangent-at-0-exact.d.ts │ │ ├── tangent-at-0-exact.js │ │ ├── tangent-at-0-exact.js.map │ │ ├── tangent-at-1-exact.d.ts │ │ ├── tangent-at-1-exact.js │ │ ├── tangent-at-1-exact.js.map │ │ ├── tangent-exact.d.ts │ │ ├── tangent-exact.js │ │ └── tangent-exact.js.map ├── local-properties-to-t │ ├── get-t-at-length.d.ts │ ├── get-t-at-length.js │ ├── get-t-at-length.js.map │ ├── t-from-xy.d.ts │ ├── t-from-xy.js │ └── t-from-xy.js.map ├── simultaneous-properties │ ├── closest-and-furthest-point-on-bezier │ │ ├── closest-point-on-bezier-certified.d.ts │ │ ├── closest-point-on-bezier-certified.js │ │ ├── closest-point-on-bezier-certified.js.map │ │ ├── closest-point-on-bezier.d.ts │ │ ├── closest-point-on-bezier.js │ │ ├── closest-point-on-bezier.js.map │ │ ├── foot-and-endpoint-info.d.ts │ │ ├── foot-and-endpoint-info.js │ │ ├── foot-and-endpoint-info.js.map │ │ ├── furthest-point-on-bezier.d.ts │ │ ├── furthest-point-on-bezier.js │ │ ├── furthest-point-on-bezier.js.map │ │ ├── get-coeffs │ │ │ ├── double-double │ │ │ │ ├── get-footpoint-poly-1-dd.d.ts │ │ │ │ ├── get-footpoint-poly-1-dd.js │ │ │ │ ├── get-footpoint-poly-1-dd.js.map │ │ │ │ ├── get-footpoint-poly-2-dd.d.ts │ │ │ │ ├── get-footpoint-poly-2-dd.js │ │ │ │ ├── get-footpoint-poly-2-dd.js.map │ │ │ │ ├── get-footpoint-poly-3-dd.d.ts │ │ │ │ ├── get-footpoint-poly-3-dd.js │ │ │ │ ├── get-footpoint-poly-3-dd.js.map │ │ │ │ ├── get-footpoint-poly-dd.d.ts │ │ │ │ ├── get-footpoint-poly-dd.js │ │ │ │ └── get-footpoint-poly-dd.js.map │ │ │ ├── double │ │ │ │ ├── get-footpoint-poly-1.d.ts │ │ │ │ ├── get-footpoint-poly-1.js │ │ │ │ ├── get-footpoint-poly-1.js.map │ │ │ │ ├── get-footpoint-poly-2.d.ts │ │ │ │ ├── get-footpoint-poly-2.js │ │ │ │ ├── get-footpoint-poly-2.js.map │ │ │ │ ├── get-footpoint-poly-3.d.ts │ │ │ │ ├── get-footpoint-poly-3.js │ │ │ │ ├── get-footpoint-poly-3.js.map │ │ │ │ ├── get-footpoint-poly.d.ts │ │ │ │ ├── get-footpoint-poly.js │ │ │ │ └── get-footpoint-poly.js.map │ │ │ ├── exact │ │ │ │ ├── get-footpoint-poly-1-exact.d.ts │ │ │ │ ├── get-footpoint-poly-1-exact.js │ │ │ │ ├── get-footpoint-poly-1-exact.js.map │ │ │ │ ├── get-footpoint-poly-2-exact.d.ts │ │ │ │ ├── get-footpoint-poly-2-exact.js │ │ │ │ ├── get-footpoint-poly-2-exact.js.map │ │ │ │ ├── get-footpoint-poly-3-exact.d.ts │ │ │ │ ├── get-footpoint-poly-3-exact.js │ │ │ │ ├── get-footpoint-poly-3-exact.js.map │ │ │ │ ├── get-footpoint-poly-exact.d.ts │ │ │ │ ├── get-footpoint-poly-exact.js │ │ │ │ └── get-footpoint-poly-exact.js.map │ │ │ ├── get-closest-on-bezier-from-point-error-counters.d.ts │ │ │ ├── get-closest-on-bezier-from-point-error-counters.js │ │ │ └── get-closest-on-bezier-from-point-error-counters.js.map │ │ ├── get-foot-points-on-bezier-certified.d.ts │ │ ├── get-foot-points-on-bezier-certified.js │ │ ├── get-foot-points-on-bezier-certified.js.map │ │ ├── get-foot-points-polys-on-bezier-certified.d.ts │ │ ├── get-foot-points-polys-on-bezier-certified.js │ │ ├── get-foot-points-polys-on-bezier-certified.js.map │ │ ├── root-interval-to-distance-squared-interval.d.ts │ │ ├── root-interval-to-distance-squared-interval.js │ │ └── root-interval-to-distance-squared-interval.js.map │ ├── closest-distance-between-beziers │ │ ├── closest-distance-between-beziers.d.ts │ │ ├── closest-distance-between-beziers.js │ │ ├── closest-distance-between-beziers.js.map │ │ ├── distance-compare.d.ts │ │ ├── distance-compare.js │ │ ├── distance-compare.js.map │ │ ├── distance-interval.d.ts │ │ ├── distance-interval.js │ │ ├── distance-interval.js.map │ │ ├── get-min-max-distance.d.ts │ │ ├── get-min-max-distance.js │ │ ├── get-min-max-distance.js.map │ │ ├── points-with-distance.d.ts │ │ ├── points-with-distance.js │ │ └── points-with-distance.js.map │ ├── equal.d.ts │ ├── equal.js │ ├── equal.js.map │ ├── get-interface-rotation.d.ts │ ├── get-interface-rotation.js │ ├── get-interface-rotation.js.map │ ├── hausdorff-distance │ │ ├── get-max-hausdorff.d.ts │ │ ├── get-max-hausdorff.js │ │ ├── get-max-hausdorff.js.map │ │ ├── hausdorff-compare.d.ts │ │ ├── hausdorff-compare.js │ │ ├── hausdorff-compare.js.map │ │ ├── hausdorff-distance-one-sided.d.ts │ │ ├── hausdorff-distance-one-sided.js │ │ ├── hausdorff-distance-one-sided.js.map │ │ ├── hausdorff-distance.d.ts │ │ ├── hausdorff-distance.js │ │ ├── hausdorff-distance.js.map │ │ ├── hausdorff-interval.d.ts │ │ ├── hausdorff-interval.js │ │ └── hausdorff-interval.js.map │ ├── heap.d.ts │ ├── heap.js │ ├── heap.js.map │ └── is-point-on-bezier-extension │ │ ├── is-point-on-bezier-extension-1.d.ts │ │ ├── is-point-on-bezier-extension-1.js │ │ ├── is-point-on-bezier-extension-1.js.map │ │ ├── is-point-on-bezier-extension-2.d.ts │ │ ├── is-point-on-bezier-extension-2.js │ │ ├── is-point-on-bezier-extension-2.js.map │ │ ├── is-point-on-bezier-extension-3.d.ts │ │ ├── is-point-on-bezier-extension-3.js │ │ ├── is-point-on-bezier-extension-3.js.map │ │ ├── is-point-on-bezier-extension.d.ts │ │ ├── is-point-on-bezier-extension.js │ │ └── is-point-on-bezier-extension.js.map ├── sub-1-ulp.d.ts ├── sub-1-ulp.js ├── sub-1-ulp.js.map ├── to-power-basis │ ├── to-power-basis-1st-derivative │ │ ├── double-double │ │ │ ├── to-power-basis-1st-derivative-dd.d.ts │ │ │ ├── to-power-basis-1st-derivative-dd.js │ │ │ └── to-power-basis-1st-derivative-dd.js.map │ │ ├── double │ │ │ ├── to-power-basis-1st-derivative.d.ts │ │ │ ├── to-power-basis-1st-derivative.js │ │ │ └── to-power-basis-1st-derivative.js.map │ │ ├── exact │ │ │ ├── to-power-basis-1st-derivative-exact.d.ts │ │ │ ├── to-power-basis-1st-derivative-exact.js │ │ │ └── to-power-basis-1st-derivative-exact.js.map │ │ ├── to-power-basis-1st-derivative-error-counters.d.ts │ │ ├── to-power-basis-1st-derivative-error-counters.js │ │ └── to-power-basis-1st-derivative-error-counters.js.map │ ├── to-power-basis-2nd-derivative │ │ ├── double-double │ │ │ ├── to-power-basis-2nd-derivative-dd.d.ts │ │ │ ├── to-power-basis-2nd-derivative-dd.js │ │ │ └── to-power-basis-2nd-derivative-dd.js.map │ │ ├── double │ │ │ ├── to-power-basis-2nd-derivative.d.ts │ │ │ ├── to-power-basis-2nd-derivative.js │ │ │ └── to-power-basis-2nd-derivative.js.map │ │ └── exact │ │ │ ├── to-power-basis-2nd-derivative-exact.d.ts │ │ │ ├── to-power-basis-2nd-derivative-exact.js │ │ │ └── to-power-basis-2nd-derivative-exact.js.map │ ├── to-power-basis-3rd-derivative │ │ ├── double-double │ │ │ ├── to-power-basis-3rd-derivative-dd.d.ts │ │ │ ├── to-power-basis-3rd-derivative-dd.js │ │ │ └── to-power-basis-3rd-derivative-dd.js.map │ │ ├── double │ │ │ ├── to-power-basis-3rd-derivative.d.ts │ │ │ ├── to-power-basis-3rd-derivative.js │ │ │ └── to-power-basis-3rd-derivative.js.map │ │ └── exact │ │ │ ├── to-power-basis-3rd-derivative-exact.d.ts │ │ │ ├── to-power-basis-3rd-derivative-exact.js │ │ │ └── to-power-basis-3rd-derivative-exact.js.map │ └── to-power-basis │ │ ├── double-double │ │ ├── to-power-basis-dd-with-running-error.d.ts │ │ ├── to-power-basis-dd-with-running-error.js │ │ ├── to-power-basis-dd-with-running-error.js.map │ │ ├── to-power-basis-dd.d.ts │ │ ├── to-power-basis-dd.js │ │ └── to-power-basis-dd.js.map │ │ ├── double │ │ ├── to-power-basis-with-running-error.d.ts │ │ ├── to-power-basis-with-running-error.js │ │ ├── to-power-basis-with-running-error.js.map │ │ ├── to-power-basis.d.ts │ │ ├── to-power-basis.js │ │ └── to-power-basis.js.map │ │ ├── exact │ │ ├── to-power-basis-exact.d.ts │ │ ├── to-power-basis-exact.js │ │ └── to-power-basis-exact.js.map │ │ ├── to-power-basis-error-counters.d.ts │ │ ├── to-power-basis-error-counters.js │ │ └── to-power-basis-error-counters.js.map └── transformation │ ├── clone.d.ts │ ├── clone.js │ ├── clone.js.map │ ├── degree-or-type │ ├── cubic-to-hybrid-quadratic.d.ts │ ├── cubic-to-hybrid-quadratic.js │ ├── cubic-to-hybrid-quadratic.js.map │ ├── cubic-to-quadratic.d.ts │ ├── cubic-to-quadratic.js │ ├── cubic-to-quadratic.js.map │ ├── line-to-cubic.d.ts │ ├── line-to-cubic.js │ ├── line-to-cubic.js.map │ ├── line-to-quadratic.d.ts │ ├── line-to-quadratic.js │ ├── line-to-quadratic.js.map │ ├── quadratic-to-cubic.d.ts │ ├── quadratic-to-cubic.js │ ├── quadratic-to-cubic.js.map │ ├── to-cubic.d.ts │ ├── to-cubic.js │ └── to-cubic.js.map │ ├── get-hodograph.d.ts │ ├── get-hodograph.js │ ├── get-hodograph.js.map │ ├── reduce-order-if-possible.d.ts │ ├── reduce-order-if-possible.js │ ├── reduce-order-if-possible.js.map │ ├── reverse.d.ts │ ├── reverse.js │ ├── reverse.js.map │ ├── split │ ├── from-to-incl-error-bound.d.ts │ ├── from-to-incl-error-bound.js │ ├── from-to-incl-error-bound.js.map │ ├── from-to.d.ts │ ├── from-to.js │ ├── from-to.js.map │ ├── from-to │ │ ├── from-to-1-incl-error-bound.d.ts │ │ ├── from-to-1-incl-error-bound.js │ │ ├── from-to-1-incl-error-bound.js.map │ │ ├── from-to-1.d.ts │ │ ├── from-to-1.js │ │ ├── from-to-1.js.map │ │ ├── from-to-2-incl-error-bound.d.ts │ │ ├── from-to-2-incl-error-bound.js │ │ ├── from-to-2-incl-error-bound.js.map │ │ ├── from-to-2.d.ts │ │ ├── from-to-2.js │ │ ├── from-to-2.js.map │ │ ├── from-to-3-incl-error-bound.d.ts │ │ ├── from-to-3-incl-error-bound.js │ │ ├── from-to-3-incl-error-bound.js.map │ │ ├── from-to-3.d.ts │ │ ├── from-to-3.js │ │ └── from-to-3.js.map │ ├── linked-list │ │ ├── linked-list-node.d.ts │ │ ├── linked-list-node.js │ │ └── linked-list-node.js.map │ ├── split-by-curvature-and-length.d.ts │ ├── split-by-curvature-and-length.js │ ├── split-by-curvature-and-length.js.map │ ├── split-by-curvature.d.ts │ ├── split-by-curvature.js │ ├── split-by-curvature.js.map │ ├── split-by-length.d.ts │ ├── split-by-length.js │ └── split-by-length.js.map │ ├── to-string.d.ts │ ├── to-string.js │ └── to-string.js.map ├── package-lock.json ├── package.json ├── performance ├── index.html ├── package-lock.json ├── package.json ├── paperjs.js ├── perf.min.js ├── react-svg-tree │ ├── src │ │ ├── helpers │ │ │ ├── node-props.ts │ │ │ ├── position-tree.ts │ │ │ ├── text-label.tsx │ │ │ ├── tree-graph.ts │ │ │ └── tree-props.ts │ │ └── tree.tsx │ └── test │ │ ├── TreeGraph.test.js │ │ └── positionTree.test.js ├── src │ ├── -paper.ts │ ├── affine.ts │ ├── are-intersections-infinite.ts │ ├── bezier-self-intersection.ts │ ├── compare-self-intersection.ts │ ├── dk.ts │ ├── do-convex-polys-intersect.ts │ ├── draw-stuff.ts │ ├── draw │ │ ├── draw-bezier.ts │ │ ├── draw-circle.ts │ │ ├── draw-coordinate-cross.ts │ │ ├── draw-cross.ts │ │ ├── draw-fatline.ts │ │ ├── draw-geo.ts │ │ ├── draw-hybrid-poly.ts │ │ ├── draw-partial-bezier.ts │ │ ├── draw-rect.ts │ │ └── draw-rotated-rect.ts │ ├── geo │ │ ├── -geo.ts │ │ ├── draw-iter-to-canvas.ts │ │ ├── render-tree.tsx │ │ ├── tc-fatline.ts │ │ ├── tc-geo.ts │ │ └── tc-ps.ts │ ├── get-curve-pairs.ts │ ├── get-pss │ │ ├── get-curves-from-pss.ts │ │ ├── get-pss.ts │ │ ├── get-same-k-pss.ts │ │ └── rand-on-grid.ts │ ├── hausdorff │ │ └── hausdorff-distance-km.ts │ ├── log.ts │ ├── naive │ │ ├── -naive.ts │ │ ├── double │ │ │ ├── get-coeffs-bez1-bez1.ts │ │ │ ├── get-coeffs-bez1-bez2.ts │ │ │ ├── get-coeffs-bez1-bez3.ts │ │ │ ├── get-coeffs-bez2-bez1.ts │ │ │ ├── get-coeffs-bez2-bez2.ts │ │ │ ├── get-coeffs-bez2-bez3.ts │ │ │ ├── get-coeffs-bez3-bez1.ts │ │ │ ├── get-coeffs-bez3-bez2.ts │ │ │ └── get-coeffs-bez3-bez3.ts │ │ ├── get-coeffs-bez3-bez3-dd-any-bitlength.ts │ │ ├── get-implicit-form3-dd-any-bitlength.ts │ │ └── get-xy-dd-any-bitlength.ts │ ├── native │ │ ├── -native.ts │ │ ├── bezier-bezier-intersection-boundless.ts │ │ ├── draw-intersections.ts │ │ ├── get-coeffs.ts │ │ ├── get-other-ts-2.ts │ │ └── pre-filter.ts │ ├── pre-filter.ts │ ├── roots │ │ ├── all-roots.ts │ │ └── brent-poly.ts │ ├── settings.ts │ ├── setup-global.ts │ ├── show-results.ts │ ├── test-bezier-intersection.ts │ ├── test-cubic-with-params-at-0.ts │ ├── to-grid.ts │ └── upd-ds.ts ├── tsconfig.json └── webpack.config.cjs ├── src ├── add-1-ulp.ts ├── angles-and-speeds │ ├── angles-and-speeds.ts │ └── bezier-by-angles-and-speeds │ │ ├── angles-and-speeds.ts │ │ ├── cubic-from-angles-and-speeds.ts │ │ ├── cubic-to-angles-and-speeds.ts │ │ ├── get-cubic-speeds.ts │ │ └── set-cubic-speeds.ts ├── bezier-piece.ts ├── boxes │ ├── are-boxes-intersecting.ts │ └── intersect-boxes.ts ├── create │ ├── cubic-through-point-given013.ts │ ├── generate-cusp-at-half-t.ts │ ├── generate-quarter-circle.ts │ └── generate-self-intersecting.ts ├── error-analysis │ ├── error-analysis.ts │ └── max-abs-coordinate.ts ├── fit │ ├── fit-quads-to-cubic-hausdorff.ts │ ├── fit-quads-to-cubic.ts │ ├── get-abs-area-between.ts │ └── quadratic-to-polyline.ts ├── from-power-basis │ └── from-power-basis.ts ├── get-curvature-extrema-dd │ ├── get-abs-curvature-extrema-polys-dd.ts │ ├── get-curvature-extrema-dd.ts │ └── get-curvature-extrema-quadratic-poly-dd.ts ├── get-curvature-extrema-e │ ├── get-abs-curvature-extrema-polys-e.ts │ ├── get-curvature-extrema-e.ts │ └── get-curvature-extrema-quadratic-poly-e.ts ├── get-curvature-extrema │ ├── get-abs-curvature-extrema-polys.ts │ ├── get-curvature-extrema-quadratic-poly.ts │ └── get-curvature-extrema.ts ├── global-properties │ ├── area.ts │ ├── bounds │ │ ├── bounds.ts │ │ ├── get-bounding-box-tight.ts │ │ ├── get-bounding-box.ts │ │ ├── get-bounding-hull.ts │ │ ├── get-bounds.ts │ │ ├── get-control-point-box.ts │ │ ├── get-interval-box │ │ │ ├── get-interval-box-dd.ts │ │ │ └── get-interval-box.ts │ │ ├── get-x-bounds-tight.ts │ │ └── get-y-bounds-tight.ts │ ├── classification │ │ ├── classify.ts │ │ ├── is-collinear.ts │ │ ├── is-cubic-really-line.ts │ │ ├── is-cubic-really-quad.ts │ │ ├── is-quad-flat.ts │ │ ├── is-quad-obtuse.ts │ │ ├── is-quad-really-line.ts │ │ ├── is-really-point.ts │ │ └── is-self-overlapping.ts │ ├── curviness.ts │ ├── get-bending-energy.ts │ ├── get-inflections.ts │ ├── length │ │ ├── control-point-lines-length.ts │ │ ├── length-bez1.ts │ │ ├── length-bez2.ts │ │ ├── length-bez3.ts │ │ ├── length.ts │ │ └── total-length.ts │ └── total-absolute-curvature.ts ├── implicit-form │ ├── double-double │ │ ├── get-implicit-form1-dd-with-running-error.ts │ │ ├── get-implicit-form1-dd.ts │ │ ├── get-implicit-form2-dd-with-running-error.ts │ │ ├── get-implicit-form2-dd.ts │ │ ├── get-implicit-form3-dd-with-running-error.ts │ │ └── get-implicit-form3-dd.ts │ ├── double │ │ ├── get-implicit-form1.ts │ │ ├── get-implicit-form2.ts │ │ └── get-implicit-form3.ts │ ├── evaluate │ │ └── double │ │ │ ├── evaluate-implicit1.ts │ │ │ ├── evaluate-implicit2.ts │ │ │ └── evaluate-implicit3.ts │ ├── exact │ │ ├── get-implicit-form1-exact.ts │ │ ├── get-implicit-form2-exact.ts │ │ └── get-implicit-form3-exact.ts │ ├── get-error-counters │ │ ├── get-implicit-form1-error-counters.ts │ │ ├── get-implicit-form2-error-counters.ts │ │ └── get-implicit-form3-error-counters.ts │ └── implicit-form-types.ts ├── index.ts ├── intersection │ ├── bezier-bezier-intersection-fast │ │ ├── bezier-bezier-intersection-fast.ts │ │ ├── check-intersection-in-ranges.ts │ │ ├── clip │ │ │ ├── geo-clip.ts │ │ │ └── to-hybrid-quadratic.ts │ │ ├── debug.ts │ │ ├── get-distance-to-line-function.ts │ │ └── iteration.ts │ ├── bezier-bezier-intersection │ │ ├── bezier-bezier-intersection-boundless.ts │ │ ├── bezier-bezier-intersection.ts │ │ ├── get-coefficients │ │ │ ├── double-double │ │ │ │ ├── get-coeffs-bez1-bez1-dd.ts │ │ │ │ ├── get-coeffs-bez1-bez2-dd.ts │ │ │ │ ├── get-coeffs-bez1-bez3-dd.ts │ │ │ │ ├── get-coeffs-bez2-bez1-dd.ts │ │ │ │ ├── get-coeffs-bez2-bez2-dd.ts │ │ │ │ ├── get-coeffs-bez2-bez3-dd.ts │ │ │ │ ├── get-coeffs-bez3-bez1-dd.ts │ │ │ │ ├── get-coeffs-bez3-bez2-dd.ts │ │ │ │ └── get-coeffs-bez3-bez3-dd.ts │ │ │ ├── exact │ │ │ │ ├── get-coeffs-bez1-bez1-exact.ts │ │ │ │ ├── get-coeffs-bez1-bez2-exact.ts │ │ │ │ ├── get-coeffs-bez1-bez3-exact.ts │ │ │ │ ├── get-coeffs-bez2-bez1-exact.ts │ │ │ │ ├── get-coeffs-bez2-bez2-exact.ts │ │ │ │ ├── get-coeffs-bez2-bez3-exact.ts │ │ │ │ ├── get-coeffs-bez3-bez1-exact.ts │ │ │ │ ├── get-coeffs-bez3-bez2-exact.ts │ │ │ │ └── get-coeffs-bez3-bez3-exact.ts │ │ │ └── get-coeffs-bez-bez.ts │ │ └── x.ts │ ├── circle-bezier-intersection │ │ ├── circle-bezier-intersection.ts │ │ ├── double-double │ │ │ └── get-coeffs-dd.ts │ │ ├── exact │ │ │ └── get-coeffs-exact.ts │ │ └── get-circle-bezier-intersection-error-counters.ts │ ├── get-endpoint-intersections │ │ ├── b-abs.ts │ │ ├── b-cbrt.ts │ │ ├── b-sign.ts │ │ ├── b-sqrt.ts │ │ ├── bigint-to-expansion.ts │ │ ├── calc-exact-cube-root.ts │ │ ├── calc-exact-square-root.ts │ │ ├── ensure-range.ts │ │ ├── er-compare.ts │ │ ├── er-estimate.ts │ │ ├── er-sign.ts │ │ ├── get-ab.ts │ │ ├── get-ab1.ts │ │ ├── get-ab2.ts │ │ ├── get-ab3.ts │ │ ├── get-endpoint-intersections.ts │ │ ├── get-transform-1.ts │ │ ├── get-transform-2.ts │ │ ├── get-transform-3.ts │ │ └── sum-bigints.ts │ └── self-intersection │ │ ├── bezier-self-intersection.ts │ │ └── get-coefficients │ │ ├── double-double │ │ └── get-coeffs-bez3-dd.ts │ │ ├── double │ │ ├── get-coeffs-bez3-with-running-error.ts │ │ └── get-coeffs-bez3.ts │ │ └── exact │ │ └── get-coeffs-bez3-exact.ts ├── local-properties-at-t │ ├── curvature.ts │ ├── dd-curvature.ts │ ├── ds.ts │ ├── e-curvature.ts │ ├── evaluate-2nd-derivative │ │ ├── double │ │ │ ├── evaluate-2nd-derivative-at-0.ts │ │ │ ├── evaluate-2nd-derivative-at-1.ts │ │ │ └── evaluate-2nd-derivative.ts │ │ └── exact │ │ │ ├── evaluate-2nd-derivative-at-0-exact.ts │ │ │ ├── evaluate-2nd-derivative-at-1-exact.ts │ │ │ └── evaluate-2nd-derivative-exact.ts │ ├── evaluate │ │ ├── double-double │ │ │ ├── eval-de-casteljau-dd.ts │ │ │ └── eval-de-casteljau-with-err-dd.ts │ │ ├── double │ │ │ ├── eval-de-casteljau-with-err.ts │ │ │ ├── eval-de-casteljau.ts │ │ │ └── evaluate.ts │ │ ├── eval-de-casteljau-error.ts │ │ └── exact │ │ │ └── evaluate-exact.ts │ ├── normal │ │ ├── normal.ts │ │ └── normal2.ts │ └── tangent │ │ ├── double │ │ ├── tangent-at-0.ts │ │ ├── tangent-at-1.ts │ │ └── tangent.ts │ │ └── exact │ │ ├── tangent-at-0-exact.ts │ │ ├── tangent-at-1-exact.ts │ │ └── tangent-exact.ts ├── local-properties-to-t │ ├── get-t-at-length.ts │ └── t-from-xy.ts ├── simultaneous-properties │ ├── closest-and-furthest-point-on-bezier │ │ ├── closest-point-on-bezier-certified.ts │ │ ├── closest-point-on-bezier.ts │ │ ├── foot-and-endpoint-info.ts │ │ ├── furthest-point-on-bezier.ts │ │ ├── get-coeffs │ │ │ ├── double-double │ │ │ │ ├── get-footpoint-poly-1-dd.ts │ │ │ │ ├── get-footpoint-poly-2-dd.ts │ │ │ │ ├── get-footpoint-poly-3-dd.ts │ │ │ │ └── get-footpoint-poly-dd.ts │ │ │ ├── double │ │ │ │ ├── get-footpoint-poly-1.ts │ │ │ │ ├── get-footpoint-poly-2.ts │ │ │ │ ├── get-footpoint-poly-3.ts │ │ │ │ └── get-footpoint-poly.ts │ │ │ ├── exact │ │ │ │ ├── get-footpoint-poly-1-exact.ts │ │ │ │ ├── get-footpoint-poly-2-exact.ts │ │ │ │ ├── get-footpoint-poly-3-exact.ts │ │ │ │ └── get-footpoint-poly-exact.ts │ │ │ └── get-closest-on-bezier-from-point-error-counters.ts │ │ ├── get-foot-points-on-bezier-certified.ts │ │ ├── get-foot-points-polys-on-bezier-certified.ts │ │ └── root-interval-to-distance-squared-interval.ts │ ├── closest-distance-between-beziers │ │ ├── closest-distance-between-beziers.ts │ │ ├── distance-compare.ts │ │ ├── distance-interval.ts │ │ ├── get-min-max-distance.ts │ │ └── points-with-distance.ts │ ├── equal.ts │ ├── get-interface-rotation.ts │ ├── hausdorff-distance │ │ ├── get-max-hausdorff.ts │ │ ├── hausdorff-compare.ts │ │ ├── hausdorff-distance-one-sided.ts │ │ ├── hausdorff-distance.ts │ │ └── hausdorff-interval.ts │ ├── heap.ts │ └── is-point-on-bezier-extension │ │ ├── is-point-on-bezier-extension-1.ts │ │ ├── is-point-on-bezier-extension-2.ts │ │ ├── is-point-on-bezier-extension-3.ts │ │ └── is-point-on-bezier-extension.ts ├── sub-1-ulp.ts ├── to-power-basis │ ├── to-power-basis-1st-derivative │ │ ├── double-double │ │ │ ├── to-power-basis-1st-derivative-dd-with-running-error.ts │ │ │ └── to-power-basis-1st-derivative-dd.ts │ │ ├── double │ │ │ └── to-power-basis-1st-derivative.ts │ │ ├── exact │ │ │ └── to-power-basis-1st-derivative-exact.ts │ │ └── to-power-basis-1st-derivative-error-counters.ts │ ├── to-power-basis-2nd-derivative │ │ ├── double-double │ │ │ └── to-power-basis-2nd-derivative-dd.ts │ │ ├── double │ │ │ └── to-power-basis-2nd-derivative.ts │ │ └── exact │ │ │ └── to-power-basis-2nd-derivative-exact.ts │ ├── to-power-basis-3rd-derivative │ │ ├── double-double │ │ │ └── to-power-basis-3rd-derivative-dd.ts │ │ ├── double │ │ │ └── to-power-basis-3rd-derivative.ts │ │ └── exact │ │ │ └── to-power-basis-3rd-derivative-exact.ts │ └── to-power-basis │ │ ├── double-double │ │ ├── to-power-basis-dd-with-running-error.ts │ │ └── to-power-basis-dd.ts │ │ ├── double │ │ ├── to-power-basis-with-running-error.ts │ │ └── to-power-basis.ts │ │ ├── exact │ │ └── to-power-basis-exact.ts │ │ └── to-power-basis-error-counters.ts └── transformation │ ├── clone.ts │ ├── degree-or-type │ ├── cubic-to-hybrid-quadratic.ts │ ├── cubic-to-quadratic.ts │ ├── line-to-cubic.ts │ ├── line-to-quadratic.ts │ ├── quadratic-to-cubic.ts │ └── to-cubic.ts │ ├── get-hodograph.ts │ ├── reduce-order-if-possible.ts │ ├── reverse.ts │ ├── split │ ├── from-to-incl-error-bound.ts │ ├── from-to.ts │ ├── from-to │ │ ├── from-to-1-incl-error-bound.ts │ │ ├── from-to-1.ts │ │ ├── from-to-2-incl-error-bound.ts │ │ ├── from-to-2.ts │ │ ├── from-to-3-incl-error-bound.ts │ │ └── from-to-3.ts │ ├── linked-list │ │ └── linked-list-node.ts │ ├── split-by-curvature-and-length.ts │ ├── split-by-curvature.ts │ └── split-by-length.ts │ ├── to-estimation.ts │ ├── to-expansion.ts │ └── to-string.ts ├── test ├── add-1-ulp.spec.ts ├── boxes │ ├── are-boxes-intersecting.spec.ts │ └── intersect-boxes.spec.ts ├── chai-extensions.d.ts ├── create │ ├── cubic-through-point-given013.spec.ts │ ├── generate-cusp-at-half-t.spec.ts │ └── generate-self-intersecting.spec.ts ├── fit │ ├── fit-quads-to-cubic.spec.ts │ └── quadratic-to-polyline.spec.ts ├── from-power-basis │ └── from-power-basis.spec.ts ├── get-curvature-extrema │ └── get-curvature-extrema.spec.ts ├── global-properties │ ├── area.spec.ts │ ├── bounds │ │ ├── get-bounding-box-tight.spec.ts │ │ ├── get-bounding-box.spec.ts │ │ ├── get-bounds.spec.ts │ │ ├── get-control-point-box.spec.ts │ │ ├── get-interval-box │ │ │ ├── get-interval-box-dd.spec.ts │ │ │ └── get-interval-box.spec.ts │ │ ├── get-x-bounds-tight.spec.ts │ │ └── get-y-bounds-tight.spec.ts │ ├── classification │ │ ├── classify.spec.ts │ │ ├── is-collinear.spec.ts │ │ ├── is-cubic-really-line.spec.ts │ │ ├── is-cubic-really-quad.spec.ts │ │ ├── is-quad-flat.spec.ts │ │ ├── is-quad-obtuse.spec.ts │ │ ├── is-quad-really-line.spec.ts │ │ ├── is-really-point.spec.ts │ │ └── is-self-overlapping.spec.ts │ ├── curviness.spec.ts │ ├── get-bending-energy.spec.ts │ ├── get-inflections.spec.ts │ ├── length │ │ ├── control-point-lines-length.spec.ts │ │ ├── length-approx.spec.ts │ │ ├── length.spec.ts │ │ └── total-length.spec.ts │ └── total-curvature.spec.ts ├── helpers │ ├── chai-extend-nearly.ts │ ├── close-to.ts │ ├── create-cubic-thats-really-quad.ts │ ├── get-random-bezier.ts │ ├── hausdorff-distance-naive.ts │ ├── heap-to-str.ts │ ├── intersection-fast │ │ ├── check-results.ts │ │ ├── geo.ts │ │ ├── native.ts │ │ └── upd-ds.ts │ ├── intersection │ │ ├── are-intersections-infinite.ts │ │ ├── are-intersections-ordered.ts │ │ ├── get-pss-with-infinite-xs.ts │ │ ├── get-pss.ts │ │ ├── get-special-pss.ts │ │ └── swap-intersections.ts │ ├── map.ts │ ├── obj-or-array.ts │ ├── rad-to-deg.ts │ ├── random-on-grid.ts │ ├── random-rotate-and-translate.ts │ ├── random-translate.ts │ ├── reverse-bound-ts.ts │ └── to-grid.ts ├── implicit-form │ ├── evaluate │ │ └── double │ │ │ └── evaluate-implicit123.spec.ts │ └── implicit-form.spec.ts ├── intersection │ ├── bezier-bezier-intersection-fast │ │ ├── bezier-bezier-intersection-fast.spec.ts │ │ └── specific-cases.spec.ts │ ├── bezier-bezier-intersection │ │ ├── b-cbrt.spec.ts │ │ ├── b-sign.spec.ts │ │ ├── b-sqrt.spec.ts │ │ ├── bezier-bezier-intersection-specific-cases.spec.ts │ │ ├── bezier-bezier-intersection.spec.ts │ │ ├── bigint-to-expansion.spec.ts │ │ ├── coeffs.spec.ts │ │ ├── ensure-range.spec.ts │ │ └── get-endpoint-intersections.spec.ts │ ├── circle-bezier-intersection.spec.ts │ └── self-intersection │ │ └── self-intersection.spec.ts ├── local-properties-at-t │ ├── curvature.spec.ts │ ├── evaluate-2nd-derivative │ │ ├── double │ │ │ ├── evaluate-2nd-derivative-at-0.spec.ts │ │ │ ├── evaluate-2nd-derivative-at-1.spec.ts │ │ │ └── evaluate-2nd-derivative.spec.ts │ │ └── exact │ │ │ ├── evaluate-2nd-derivative-at-0-exact.spec.ts │ │ │ ├── evaluate-2nd-derivative-at-1-exact.spec.ts │ │ │ └── evaluate-2nd-derivative-exact.spec.ts │ ├── evaluate │ │ ├── double-double │ │ │ ├── eval-de-casteljau-dd.spec.ts │ │ │ └── eval-de-casteljau-with-err-dd.spec.ts │ │ ├── double │ │ │ ├── eval-de-casteljau-with-err.spec.ts │ │ │ ├── eval-de-casteljau.spec.ts │ │ │ └── evaluate.spec.ts │ │ └── exact │ │ │ └── evaluate-exact.spec.ts │ ├── normal │ │ ├── normal.spec.ts │ │ └── normal2.spec.ts │ └── tangent │ │ ├── double │ │ ├── tangent-at-0.spec.ts │ │ ├── tangent-at-1.spec.ts │ │ └── tangent.spec.ts │ │ ├── exact │ │ ├── tangent-at-0-exact.spec.ts │ │ ├── tangent-at-1-exact.spec.ts │ │ └── tangent-exact.spec.ts │ │ └── tangent.spec.ts ├── local-properties-to-t │ ├── get-t-at-length.spec.ts │ └── t-from-xy.spec.ts ├── simultaneous-properties │ ├── closest-and-furthest-point-on-bezier │ │ ├── closest-point-on-bezier-certified.spec.ts │ │ ├── closest-point-on-bezier.spec.ts │ │ ├── furthest-point-on-bezier.spec.ts │ │ └── get-coeffs │ │ │ ├── double-double │ │ │ └── get-footpoint-poly-dd.spec.ts │ │ │ ├── double │ │ │ └── get-footpoint-poly.spec.ts │ │ │ └── exact │ │ │ └── get-footpoint-poly-exact.spec.ts │ ├── equal.spec.ts │ ├── get-interface-rotation.spec.ts │ ├── hausdorff-distance.spec.ts │ └── is-point-on-bezier-extension │ │ └── is-point-on-bezier-extension.spec.ts ├── sub-1-ulp.spec.ts ├── test-helpers.spec.ts ├── to-power-basis │ ├── to-power-basis-1st-derivative │ │ ├── double-double │ │ │ └── to-power-basis-1st-derivative-dd.spec.ts │ │ ├── double │ │ │ └── to-power-basis-1st-derivative.spec.ts │ │ ├── exact │ │ │ └── to-power-basis-1st-derivative-exact.spec.ts │ │ └── to-power-basis-1st-derivative-error-counters.spec.ts │ ├── to-power-basis-2nd-derivative │ │ ├── double-double │ │ │ └── to-power-basis-2nd-derivative-dd.spec.ts │ │ ├── double │ │ │ └── to-power-basis-2nd-derivative.spec.ts │ │ └── exact │ │ │ └── to-power-basis-2nd-derivative-exact.spec.ts │ ├── to-power-basis-3rd-derivative │ │ ├── double-double │ │ │ └── to-power-basis-3rd-derivative-dd.spec.ts │ │ ├── double │ │ │ └── to-power-basis-3rd-derivative.spec.ts │ │ └── exact │ │ │ └── to-power-basis-3rd-derivative-exact.spec.ts │ └── to-power-basis │ │ ├── double-double │ │ ├── to-power-basis-dd-with-running-error.spec.ts │ │ └── to-power-basis-dd.spec.ts │ │ ├── double │ │ ├── to-power-basis-with-running-error.spec.ts │ │ └── to-power-basis.spec.ts │ │ ├── exact │ │ └── to-power-basis-exact.spec.ts │ │ └── to-power-basis-error-counters.spec.ts └── transformation │ ├── clone.spec.ts │ ├── degree-or-type │ ├── cubic-to-hybrid-quadratic.spec.ts │ ├── cubic-to-quadratic.spec.ts │ ├── line-to-cubic.spec.ts │ ├── line-to-quadratic.spec.ts │ ├── quadratic-to-cubic.spec.ts │ └── to-cubic.spec.ts │ ├── get-hodograph.spec.ts │ ├── get-transformed-ts.spec.ts │ ├── reverse.spec.ts │ ├── split │ ├── from-to-incl-error-bound.spec.ts │ ├── from-to.spec.ts │ ├── split-by-curvature-and-length.spec.ts │ ├── split-by-curvature.spec.ts │ └── split-by-length.spec.ts │ ├── to-estimation.spec.ts │ ├── to-expansion.spec.ts │ └── to-string.spec.ts ├── tsconfig.json ├── wallaby.mjs └── webpack.config.cjs /.gitattributes: -------------------------------------------------------------------------------- 1 | * linguist-vendored 2 | *.ts linguist-vendored=false -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | c.bat 2 | d.bat 3 | npm-debug.log 4 | papers 5 | research/ 6 | node_modules/ 7 | experiments 8 | docs-create 9 | todo.txt 10 | experiments/ 11 | experiments-new/ 12 | notes.txt 13 | coverage/ 14 | .vscode/ 15 | quokka-test.ts 16 | *.py 17 | src/__pycache__/ 18 | copydocs.bat -------------------------------------------------------------------------------- /.mocharc.cjs: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | require: "ts-node/register", 5 | extension: ['ts', 'tsx'], 6 | spec: ['test/**/*.spec.ts'], 7 | recursive: true, 8 | loader: ['ts-node/esm'], 9 | // slow: '75', 10 | // timeout: '2000', 11 | // ignore: ['/path/to/some/ignored/file'], 12 | color: true, 13 | diff: true, 14 | exit: false, 15 | parallel: true, 16 | timeout: '2000', 17 | 'v8-stack-trace-limit': 100 // V8 flags are prepended with "v8-" 18 | }; -------------------------------------------------------------------------------- /.quokka: -------------------------------------------------------------------------------- 1 | { 2 | "stdEsm": false, 3 | "nativeEsm": true 4 | } -------------------------------------------------------------------------------- /d.bat: -------------------------------------------------------------------------------- 1 | cd node_modules 2 | del /f/q/s *.* > nul 3 | cd.. 4 | rmdir /q/s node_modules -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlorisSteenkamp/FloBezier/ab2def569c971a168257d9512d14030ebda53e49/docs/.nojekyll -------------------------------------------------------------------------------- /docs/assets/js/5565b1f8.ea6b9ee5.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmy_website=self.webpackChunkmy_website||[]).push([[7779],{5745:function(e){e.exports=JSON.parse('{"name":"docusaurus-plugin-content-pages","id":"default"}')}}]); -------------------------------------------------------------------------------- /docs/assets/js/b99b386c.fc1c5d1a.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmy_website=self.webpackChunkmy_website||[]).push([[9657],{3769:function(e){e.exports=JSON.parse('{"name":"docusaurus-plugin-content-docs","id":"default"}')}}]); -------------------------------------------------------------------------------- /docs/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlorisSteenkamp/FloBezier/ab2def569c971a168257d9512d14030ebda53e49/docs/img/docusaurus.png -------------------------------------------------------------------------------- /docs/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlorisSteenkamp/FloBezier/ab2def569c971a168257d9512d14030ebda53e49/docs/img/favicon.ico -------------------------------------------------------------------------------- /docs/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlorisSteenkamp/FloBezier/ab2def569c971a168257d9512d14030ebda53e49/docs/img/logo.png -------------------------------------------------------------------------------- /node/add-1-ulp.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Add one unit in the last place (ulp) to the given number 3 | * 4 | * * subnormal numbers (and 0) are returned unaltered 5 | * @internal 6 | */ 7 | declare function add1Ulp(n: number): number; 8 | export { add1Ulp }; 9 | -------------------------------------------------------------------------------- /node/add-1-ulp.js: -------------------------------------------------------------------------------- 1 | const { EPSILON: eps } = Number; 2 | const u = eps / 2; 3 | const es = (eps ** 2) / 2; 4 | const ups = u + es; 5 | /** 6 | * Add one unit in the last place (ulp) to the given number 7 | * 8 | * * subnormal numbers (and 0) are returned unaltered 9 | * @internal 10 | */ 11 | function add1Ulp(n) { 12 | return n > 0 ? n + n * ups : n - n * ups; 13 | } 14 | export { add1Ulp }; 15 | //# sourceMappingURL=add-1-ulp.js.map -------------------------------------------------------------------------------- /node/add-1-ulp.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"add-1-ulp.js","sourceRoot":"","sources":["../src/add-1-ulp.ts"],"names":[],"mappings":"AAAA,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;AAEhC,MAAM,CAAC,GAAG,GAAG,GAAC,CAAC,CAAC;AAChB,MAAM,EAAE,GAAG,CAAC,GAAG,IAAE,CAAC,CAAC,GAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;AAGnB;;;;;GAKG;AACH,SAAS,OAAO,CAAC,CAAS;IACtB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAC,GAAG,CAAC;AACzC,CAAC;AAGD,OAAO,EAAE,OAAO,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/angles-and-speeds/angles-and-speeds.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=angles-and-speeds.js.map -------------------------------------------------------------------------------- /node/angles-and-speeds/angles-and-speeds.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"angles-and-speeds.js","sourceRoot":"","sources":["../../src/angles-and-speeds/angles-and-speeds.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node/angles-and-speeds/bezier-by-angles-and-speeds/angles-and-speeds.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=angles-and-speeds.js.map -------------------------------------------------------------------------------- /node/angles-and-speeds/bezier-by-angles-and-speeds/angles-and-speeds.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"angles-and-speeds.js","sourceRoot":"","sources":["../../../src/angles-and-speeds/bezier-by-angles-and-speeds/angles-and-speeds.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node/angles-and-speeds/bezier-by-angles-and-speeds/cubic-from-angles-and-speeds.d.ts: -------------------------------------------------------------------------------- 1 | import { AnglesAndSpeeds } from "./angles-and-speeds.js"; 2 | /** 3 | * Returns a cubic bezier curve (given by its control points) with the given 4 | * angles-and-speeds parameters. 5 | * 6 | * @param α initial tangent angle in radians 7 | * @param β terminal tangent angle in radians 8 | * @param s0 inital speed 9 | * @param s1 terminal speed 10 | * @param L distance between initial and final point (cannot be 0) 11 | * @param rot rotation of entire curve 12 | * @param p initial position offset 13 | */ 14 | declare function cubicFromAnglesAndSpeeds(anglesAndSpeeds: AnglesAndSpeeds): number[][]; 15 | export { cubicFromAnglesAndSpeeds }; 16 | -------------------------------------------------------------------------------- /node/angles-and-speeds/bezier-by-angles-and-speeds/cubic-to-angles-and-speeds.d.ts: -------------------------------------------------------------------------------- 1 | import { AnglesAndSpeeds } from "../angles-and-speeds"; 2 | /** 3 | * For the given bernstein cubic bezier curve basis return the angles-and-speeds 4 | * basis coefficients, i.e. 5 | * * α -> initial tangent angle in degrees 6 | * * β -> terminal tangent angle in degrees 7 | * * s0 -> inital speed 8 | * * s1 -> terminal speed 9 | * * L -> distance between initial and final point (cannot be 0) 10 | * * rot -> rotation of entire curve 11 | * * p -> initial position offset 12 | * 13 | * @param ps an order 3 (cubic) bezier curve given as an ordered array of its 14 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 15 | */ 16 | declare function cubicToAnglesAndSpeeds(ps: number[][]): AnglesAndSpeeds; 17 | export { cubicToAnglesAndSpeeds }; 18 | -------------------------------------------------------------------------------- /node/angles-and-speeds/bezier-by-angles-and-speeds/get-cubic-speeds.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * For the given bernstein basis cubic bezier curve return its initial and 3 | * terminal speeds in the form `[s0,s1]`. 4 | * 5 | * @param ps an order 3 (cubic) bezier curve given as an ordered array of its 6 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 7 | */ 8 | declare function getCubicSpeeds(ps: number[][]): number[]; 9 | export { getCubicSpeeds }; 10 | -------------------------------------------------------------------------------- /node/angles-and-speeds/bezier-by-angles-and-speeds/set-cubic-speeds.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * For the given bernstein basis cubic bezier curve return a new cubic bezier 3 | * curve with its initial and terminal speeds modified. 4 | * 5 | * * only the 2nd and 3rd control points are modified 6 | * * call the original curve `A` and the returned curve `B` then it will be 7 | * true that `A[0] === B[0]` and `A[3] === B[3]` 8 | * 9 | * @param ps an order 3 (cubic) bezier curve given as an ordered array of its 10 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 11 | */ 12 | declare function setCubicSpeeds(ps: number[][], s0: number, s1: number): number[][]; 13 | export { setCubicSpeeds }; 14 | -------------------------------------------------------------------------------- /node/bezier-piece.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal but kept for backwards compatibility */ 2 | interface BezierPiece { 3 | readonly ps: number[][]; 4 | readonly ts: number[]; 5 | } 6 | export type { BezierPiece }; 7 | -------------------------------------------------------------------------------- /node/bezier-piece.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=bezier-piece.js.map -------------------------------------------------------------------------------- /node/bezier-piece.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"bezier-piece.js","sourceRoot":"","sources":["../src/bezier-piece.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node/boxes/are-boxes-intersecting.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the 2 given axis-aligned rectangular boxes intersect. 3 | * 4 | * * **exact**: not susceptible to floating point round-off 5 | * 6 | * @param closed if `true`, interpret boxes as being closed (i.e. they contain 7 | * their border), otherwise open. 8 | * @param a an axis-aligned rectangular box (given by an array of two points, 9 | * e.g. `[[1,2], [3,4]]`) 10 | * @param b another axis-aligned rectangular box 11 | * 12 | * @doc mdx 13 | */ 14 | declare function areBoxesIntersecting(closed: boolean, a: number[][], b: number[][]): boolean; 15 | export { areBoxesIntersecting }; 16 | -------------------------------------------------------------------------------- /node/boxes/intersect-boxes.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the intersection of 2 given axis-aligned rectangular boxes (or 3 | * `undefined` if they don't intersect). 4 | * 5 | * * **exact**: not susceptible to floating point round-off 6 | * * **closed**: interpret boxes as being closed (i.e. they contain their border). 7 | * 8 | * @param a an axis-aligned rectangular box (given by an array of two points, 9 | * e.g. `[[1,2], [3,4]]`) 10 | * @param b another box 11 | * 12 | * @doc mdx 13 | */ 14 | declare function intersectBoxes(a: number[][], b: number[][]): number[][] | undefined; 15 | export { intersectBoxes }; 16 | -------------------------------------------------------------------------------- /node/create/cubic-through-point-given013.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generates and returns a cubic bezier curve going through a specific point 3 | * given control points 0,1 and 3. 4 | * 5 | * * **non-exact:** the returned bezier does not necessarily go through the 6 | * point *exactly* (due to floating-point round-off). 7 | * 8 | * @param ps a cubic bezier curve's 1st, 2nd and 4th control point coordinates, 9 | * i.e. `[[x0,y0], [x1,y1], [x3,y3]]`, e.g. `[[1,2], [3,4], [5,6]]` 10 | * @param p a point through which the bezier should go, e.g. `[4.5,6.1]` 11 | * @param t a `t` parameter value at which the bezier should go through the 12 | * point - this is necessary due to a degree of freedom still left 13 | * 14 | * @doc mdx 15 | */ 16 | declare function cubicThroughPointGiven013(ps: number[][], p: number[], t: number): number[][]; 17 | export { cubicThroughPointGiven013 }; 18 | -------------------------------------------------------------------------------- /node/create/generate-cusp-at-half-t.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the cubic bezier curve control points with a zero tangent vector 3 | * (i.e. `[0,0]`) at `t = 0.5` (i.e. a 'cusp') at the given point with 4 | * given starting and ending control points. 5 | * * **non-exact**: due to floating-point round-off the cusp is not 6 | * necessarily *exactly* at the given point, nor does the tangent vector 7 | * necessarily vanish *exactly*. 8 | * 9 | * @param p0 the bezier start point 10 | * @param pz the point at which the vanishing tangent should occur 11 | * @param pE the bezier end point 12 | * 13 | * @doc mdx 14 | */ 15 | declare function generateCuspAtHalf3(p0: number[], pz: number[], pE: number[]): number[][]; 16 | export { generateCuspAtHalf3 }; 17 | -------------------------------------------------------------------------------- /node/create/generate-quarter-circle.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a cubic bezier curve that is an approximation of the unit quarter 3 | * circle in the first quadrant scaled and then translated. 4 | * 5 | * * see: [Approximate a circle with cubic Bézier curves](https://spencermortensen.com/articles/bezier-circle/) 6 | * 7 | * @doc mdx 8 | */ 9 | declare function generateQuarterCircle(scale: number, translation: number[]): number[][]; 10 | export { generateQuarterCircle }; 11 | -------------------------------------------------------------------------------- /node/create/generate-quarter-circle.js: -------------------------------------------------------------------------------- 1 | import { translate } from "flo-vector2d"; 2 | /** 3 | * Returns a cubic bezier curve that is an approximation of the unit quarter 4 | * circle in the first quadrant scaled and then translated. 5 | * 6 | * * see: [Approximate a circle with cubic Bézier curves](https://spencermortensen.com/articles/bezier-circle/) 7 | * 8 | * @doc mdx 9 | */ 10 | function generateQuarterCircle(scale, translation) { 11 | // `c` can be made slightly more accurate by calculating a more accurate 12 | // value of 13 | // const c = 0.551915024494; 14 | const c = 0.5519150244935105707435627; 15 | const s = scale; 16 | return [[0, s], [s * c, s], [s, s * c], [s, 0]].map(translate(translation)); 17 | } 18 | export { generateQuarterCircle }; 19 | //# sourceMappingURL=generate-quarter-circle.js.map -------------------------------------------------------------------------------- /node/create/generate-quarter-circle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"generate-quarter-circle.js","sourceRoot":"","sources":["../../src/create/generate-quarter-circle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;;;GAOG;AACH,SAAS,qBAAqB,CACtB,KAAa,EACb,WAAqB;IAEzB,wEAAwE;IACxE,YAAY;IACZ,4BAA4B;IAC5B,MAAM,CAAC,GAAG,2BAA2B,CAAA;IACrC,MAAM,CAAC,GAAG,KAAK,CAAC;IAEhB,OAAO,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAC,CAAC,EAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAC,CAAC,GAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AACxE,CAAC;AAGD,OAAO,EAAE,qBAAqB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/create/generate-self-intersecting.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the cubic bezier curve with given starting, 2nd and 3rd control 3 | * points such that there is a self-intersection. 4 | * 5 | * * **in-exact:** the result may not be exact due to floating point round-off 6 | * 7 | * @param ts the two `t` values where the self-intersection should occur 8 | * @param p0 the bezier's initial control point, e.g. `[1,2]` 9 | * @param p1 the bezier's 2nd control point 10 | * @param p2 the bezier's 3rd control point 11 | * 12 | * @doc mdx 13 | */ 14 | declare function generateSelfIntersecting(p0: number[], p1: number[], p2: number[], ts: number[]): number[][]; 15 | export { generateSelfIntersecting }; 16 | -------------------------------------------------------------------------------- /node/error-analysis/error-analysis.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function γ(n: number): number; 3 | /** @internal */ 4 | declare function γγ(n: number): number; 5 | export { γ, γγ }; 6 | -------------------------------------------------------------------------------- /node/error-analysis/error-analysis.js: -------------------------------------------------------------------------------- 1 | const u = Number.EPSILON / 2; 2 | const uu = u * u; 3 | /** @internal */ 4 | function γ(n) { 5 | const nu = n * u; 6 | return nu / (1 - nu); 7 | } 8 | /** @internal */ 9 | function γγ(n) { 10 | const nuu = n * uu; 11 | return nuu / (1 - nuu); 12 | } 13 | export { γ, γγ }; 14 | γ(1); //=> 1.1102230246251568e-16 15 | γγ(3); //=> 3.697785493223493e-32 16 | //# sourceMappingURL=error-analysis.js.map -------------------------------------------------------------------------------- /node/error-analysis/error-analysis.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"error-analysis.js","sourceRoot":"","sources":["../../src/error-analysis/error-analysis.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;AAC7B,MAAM,EAAE,GAAG,CAAC,GAAC,CAAC,CAAC;AAEf,gBAAgB;AAChB,SAAS,CAAC,CAAC,CAAS;IAChB,MAAM,EAAE,GAAG,CAAC,GAAC,CAAC,CAAC;IACf,OAAO,EAAE,GAAC,CAAC,CAAC,GAAC,EAAE,CAAC,CAAC;AACrB,CAAC;AAGD,gBAAgB;AAChB,SAAS,EAAE,CAAC,CAAS;IACjB,MAAM,GAAG,GAAG,CAAC,GAAC,EAAE,CAAC;IACjB,OAAO,GAAG,GAAC,CAAC,CAAC,GAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAGD,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAA;AAGhB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAG,2BAA2B;AACnC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,0BAA0B"} -------------------------------------------------------------------------------- /node/error-analysis/max-abs-coordinate.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the maximum absolute value of the coordinates of the control points 3 | * of the given bezier curve. 4 | * 5 | * @param ps an order 1,2 or 3 bezier curve given as an ordered array of its 6 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 7 | * 8 | * @doc 9 | */ 10 | declare function maxAbsCoordinate(ps: number[][]): number; 11 | export { maxAbsCoordinate }; 12 | -------------------------------------------------------------------------------- /node/error-analysis/max-abs-coordinate.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the maximum absolute value of the coordinates of the control points 3 | * of the given bezier curve. 4 | * 5 | * @param ps an order 1,2 or 3 bezier curve given as an ordered array of its 6 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 7 | * 8 | * @doc 9 | */ 10 | function maxAbsCoordinate(ps) { 11 | let m = Number.NEGATIVE_INFINITY; 12 | for (let i = 0; i < ps.length; i++) { 13 | const p = ps[i]; 14 | const absX = Math.abs(p[0]); 15 | const absY = Math.abs(p[1]); 16 | if (absX > m) { 17 | m = absX; 18 | } 19 | if (absY > m) { 20 | m = absY; 21 | } 22 | } 23 | return m; 24 | } 25 | export { maxAbsCoordinate }; 26 | //# sourceMappingURL=max-abs-coordinate.js.map -------------------------------------------------------------------------------- /node/error-analysis/max-abs-coordinate.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"max-abs-coordinate.js","sourceRoot":"","sources":["../../src/error-analysis/max-abs-coordinate.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,SAAS,gBAAgB,CAAC,EAAc;IACpC,IAAI,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACjC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QAChB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;YAAC,CAAC,GAAG,IAAI,CAAC;QAAC,CAAC;QAC3B,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;YAAC,CAAC,GAAG,IAAI,CAAC;QAAC,CAAC;IAC/B,CAAC;IAED,OAAO,CAAC,CAAC;AACb,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/fit/fit-quads-to-cubic-hausdorff.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Approximate the given cubic bezier curve (up to the given tolerance) by 3 | * fitting an array of ordered (by `t` value) piecewise bezier curves 4 | * (of quadratic order or less). 5 | * 6 | * * the start and end point of each approximating curve lies on the cubic 7 | * curve and the the tangents of each approximating curve coincide with that of 8 | * the cubic at each such point 9 | * 10 | * @param ps a cubic bezier curve given as an ordered array of its 11 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 12 | * @param tolerance tolerance given as the maximum hausdorff distance between 13 | * the two curves 14 | * 15 | * @doc mdx 16 | */ 17 | declare function fitQuadsToCubicHausdorff(ps: number[][], tolerance: number): number[][][]; 18 | export { fitQuadsToCubicHausdorff }; 19 | -------------------------------------------------------------------------------- /node/fit/fit-quads-to-cubic.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Approximate the given cubic bezier curve (up to the given tolerance) by 3 | * fitting an array of ordered (by `t` value) piecewise bezier curves 4 | * (of quadratic order or less). 5 | * 6 | * * the start and end point of each approximating curve lies on the cubic 7 | * curve and the the tangents of each approximating curve coincide with that of 8 | * the cubic at each such point 9 | * 10 | * @param ps a cubic bezier curve given as an ordered array of its 11 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 12 | * @param tolerance tolerance given as the maximum total absolute area difference 13 | * between the two curves 14 | * 15 | * @doc mdx 16 | */ 17 | declare function fitQuadsToCubic(ps: number[][], tolerance: number): number[][][]; 18 | export { fitQuadsToCubic }; 19 | -------------------------------------------------------------------------------- /node/fit/get-abs-area-between.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the *absolute* area between the two given curves. 3 | * 4 | * * **precondition**: the first and last control points of each curve must be equal 5 | * * **precondition**: neither curve should have self-intersections else the results 6 | * are ambiguous 7 | * * can be used as an excellent error measure of the similarity between the two curves 8 | * 9 | * @doc mdx 10 | */ 11 | declare function getAbsAreaBetween(ps1: number[][], ps2: number[][]): number; 12 | export { getAbsAreaBetween }; 13 | -------------------------------------------------------------------------------- /node/fit/quadratic-to-polyline.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Transforms the given quadratic bezier curve into a polyline approximation to 3 | * within a given tolerance and returns the result. 4 | * 5 | * @param ps a quadratic bezier curve given as an ordered array of its 6 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 7 | * @param tolerance defaults to `2**-10` of the maximum coordinate of the given 8 | * bezier curve; a tolerance given as the maximum Hausdorff distance allowed 9 | * between the polyline and the bezier curve 10 | * 11 | * @doc mdx 12 | */ 13 | declare function quadraticToPolyline(ps: number[][], tolerance?: number): number[][]; 14 | export { quadraticToPolyline }; 15 | -------------------------------------------------------------------------------- /node/from-power-basis/from-power-basis.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the Bernstein basis representation (i.e. control points) of a line, 3 | * quadratic or cubic bezier given its power bases. 4 | * 5 | * * **non-exact**: due to floating-point round-off (see implementation to 6 | * understand under what conditions the result would be exact) 7 | * 8 | * @param cs An order 1,2 or 3 parametric curve in power bases with the 9 | * x-coordinate coefficients given first (as an array representing the 10 | * polynomial from highest to lowest power coefficient), e.g. `[[1,2,3,4], 11 | * [5,6,7,8]]` represents a cubic parametric curve given by 12 | * `x(t) = t^3 + 2t^2 + 3t^3 + 4t^4, y(t) = 5t^3 + 6t^2 + 7t + 8`. 13 | * 14 | * @doc 15 | */ 16 | declare function fromPowerBasis(cs: number[][]): number[][]; 17 | export { fromPowerBasis }; 18 | -------------------------------------------------------------------------------- /node/get-curvature-extrema-dd/get-curvature-extrema-quadratic-poly-dd.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the polynomial whose zero is the t value of maximum absolute 3 | * curvature for the given *quadratic* bezier curve. 4 | * 5 | * * **precondition:** the given parabola is not degenerate to a line 6 | * * **non-exact:** there is floating point roundof during calculation 7 | * * see e.g. [math.stackexchange](https://math.stackexchange.com/a/2971112)'s 8 | * answer by [KeithWM](https://math.stackexchange.com/a/2971112/130809) 9 | * 10 | * @param ps an order 2 bezier curve given as an array of control points, 11 | * e.g. `[[0,0],[1,1],[2,1]]` 12 | * 13 | * @internal 14 | */ 15 | declare function getCurvatureExtremaQuadraticPolyDd(ps: number[][]): number[][]; 16 | export { getCurvatureExtremaQuadraticPolyDd }; 17 | -------------------------------------------------------------------------------- /node/get-curvature-extrema-e/get-curvature-extrema-quadratic-poly-e.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the polynomial whose zero is the t value of maximum absolute 3 | * curvature for the given *quadratic* bezier curve. 4 | * 5 | * * **precondition:** the given parabola is not degenerate to a line 6 | * * **non-exact:** there is floating point roundof during calculation 7 | * * see e.g. [math.stackexchange](https://math.stackexchange.com/a/2971112)'s 8 | * answer by [KeithWM](https://math.stackexchange.com/a/2971112/130809) 9 | * 10 | * @param ps an order 2 bezier curve given as an array of control points, 11 | * e.g. `[[0,0],[1,1],[2,1]]` 12 | * 13 | * @internal 14 | */ 15 | declare function getCurvatureExtremaQuadraticPolyE(ps: number[][]): number[][]; 16 | export { getCurvatureExtremaQuadraticPolyE }; 17 | -------------------------------------------------------------------------------- /node/get-curvature-extrema/get-curvature-extrema-quadratic-poly.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the polynomial whose zero is the t value of maximum absolute 3 | * curvature for the given *quadratic* bezier curve. 4 | * 5 | * * **precondition:** the given parabola is not degenerate to a line 6 | * * **non-exact:** there is floating point roundof during calculation 7 | * * see e.g. [math.stackexchange](https://math.stackexchange.com/a/2971112)'s 8 | * answer by [KeithWM](https://math.stackexchange.com/a/2971112/130809) 9 | * 10 | * @param ps an order 2 bezier curve given as an array of control points, 11 | * e.g. `[[0,0],[1,1],[2,1]]` 12 | * 13 | * @internal 14 | */ 15 | declare function getCurvatureExtremaQuadraticPoly(ps: number[][]): number[]; 16 | export { getCurvatureExtremaQuadraticPoly }; 17 | -------------------------------------------------------------------------------- /node/global-properties/area.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the signed area between the given bezier curve and the line between 3 | * its 1st and last control points. 4 | * 5 | * @param ps an order 1,2 or 3 bezier curve given as an ordered array of its 6 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 7 | */ 8 | declare function area(ps: number[][]): number; 9 | export { area }; 10 | -------------------------------------------------------------------------------- /node/global-properties/area.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"area.js","sourceRoot":"","sources":["../../src/global-properties/area.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yFAAyF,CAAC;AAGrI;;;;;;GAMG;AACH,SAAS,IAAI,CACL,EAAc;IAElB,MAAM,CAAC,CAAC,EAAC,CAAC,CAAC,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,EAAC,EAAE,CAAC,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAC;IAE/C,MAAM,IAAI,GAAG,SAAS,CAClB,QAAQ,CACJ,QAAQ,CAAC,CAAC,EAAC,EAAE,CAAC,EACd,QAAQ,CAAC,CAAC,EAAC,EAAE,CAAC,CACjB,EAAE,CAAC,CACP,CAAC;IAEF,mEAAmE;IACnE,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,KAAK,GAAG,CAAC,CAAC;AACrB,CAAC;AAGD,OAAO,EAAE,IAAI,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/global-properties/bounds/bounds.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A bound used in specifying bounding boxes of bezier curves. 3 | */ 4 | interface Bound { 5 | /** a certified (max `4*eps` for `t ∈ [0,1]`) `t` range containing the bound */ 6 | ts: number[]; 7 | /** a certified `box` containing the bound */ 8 | box: number[][]; 9 | } 10 | /** 11 | * x-coordinate bounds used in specifying bounding boxes of bezier curves. 12 | */ 13 | interface XBounds { 14 | minX: Bound; 15 | maxX: Bound; 16 | } 17 | /** 18 | * y-coordinate bounds used in specifying bounding boxes of bezier curves. 19 | */ 20 | interface YBounds { 21 | minY: Bound; 22 | maxY: Bound; 23 | } 24 | export type { Bound, XBounds, YBounds }; 25 | -------------------------------------------------------------------------------- /node/global-properties/bounds/bounds.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=bounds.js.map -------------------------------------------------------------------------------- /node/global-properties/bounds/bounds.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"bounds.js","sourceRoot":"","sources":["../../../src/global-properties/bounds/bounds.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node/global-properties/bounds/get-bounding-box-tight.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a **non-certified**, **rotated**, **tight** bounding box of the given 3 | * bezier curve as four ordered points of a rotated rectangle (with each given 4 | * as `[x,y]`) 5 | * 6 | * @param ps an order 1,2 or 3 bezier curve given as an array of its control 7 | * points, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 8 | * 9 | * @doc mdx 10 | */ 11 | declare function getBoundingBoxTight(ps: number[][]): number[][]; 12 | export { getBoundingBoxTight }; 13 | -------------------------------------------------------------------------------- /node/global-properties/bounds/get-bounding-box.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a tight axis-aligned bounding box of the given bezier curve. 3 | * 4 | * * **certified**: the box is guaranteed to engulf the given bezier curve. 5 | * 6 | * * returns the box in the form `[[minX, minY], [maxX, maxY]` 7 | * 8 | * @param ps an order 1,2 or 3 bezier curve given as an array of its control 9 | * points, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 10 | * 11 | * @doc mdx 12 | */ 13 | declare function getBoundingBox(ps: number[][]): number[][]; 14 | export { getBoundingBox }; 15 | -------------------------------------------------------------------------------- /node/global-properties/bounds/get-bounding-box.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"get-bounding-box.js","sourceRoot":"","sources":["../../../src/global-properties/bounds/get-bounding-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D;;;;;;;;;;;GAWG;AACH,SAAS,cAAc,CAAC,EAAc;IACrC,MAAM,OAAO,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;IACpC,MAAM,OAAO,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;IAEpC,OAAO;QACN,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAChD,CAAC;AACH,CAAC;AAGD,OAAO,EAAE,cAAc,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/global-properties/bounds/get-bounding-hull.d.ts: -------------------------------------------------------------------------------- 1 | import { grahamScan } from 'flo-graham-scan'; 2 | /** 3 | * Finds the convex hull of the given set of 2d points using the 4 | * Graham Scan algorithm and returns the hull as an array of points. 5 | * 6 | * * see https://en.wikipedia.org/wiki/Graham_scan 7 | * 8 | * **exact**: this algorithm is robust via adaptive infinite precision floating 9 | * point arithmetic. 10 | * 11 | * @param ps a set of points, e.g. a bezier curve, e.g. [[0,0],[1,1],[2,1],[2,0]] 12 | * @param includeAllBoundaryPoints set this to `true` to if all boundary points 13 | * should be returned, even redundant ones; defaults to `false` 14 | * 15 | * @dox mdx 16 | */ 17 | declare const getBoundingHull: typeof grahamScan; 18 | export { getBoundingHull }; 19 | -------------------------------------------------------------------------------- /node/global-properties/bounds/get-bounding-hull.js: -------------------------------------------------------------------------------- 1 | import { grahamScan } from 'flo-graham-scan'; 2 | /** 3 | * Finds the convex hull of the given set of 2d points using the 4 | * Graham Scan algorithm and returns the hull as an array of points. 5 | * 6 | * * see https://en.wikipedia.org/wiki/Graham_scan 7 | * 8 | * **exact**: this algorithm is robust via adaptive infinite precision floating 9 | * point arithmetic. 10 | * 11 | * @param ps a set of points, e.g. a bezier curve, e.g. [[0,0],[1,1],[2,1],[2,0]] 12 | * @param includeAllBoundaryPoints set this to `true` to if all boundary points 13 | * should be returned, even redundant ones; defaults to `false` 14 | * 15 | * @dox mdx 16 | */ 17 | const getBoundingHull = grahamScan; 18 | export { getBoundingHull }; 19 | //# sourceMappingURL=get-bounding-hull.js.map -------------------------------------------------------------------------------- /node/global-properties/bounds/get-bounding-hull.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"get-bounding-hull.js","sourceRoot":"","sources":["../../../src/global-properties/bounds/get-bounding-hull.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C;;;;;;;;;;;;;;GAcG;AACF,MAAM,eAAe,GAAG,UAAU,CAAC;AAGnC,OAAO,EAAE,eAAe,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/global-properties/bounds/get-bounds.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns an axis-aligned bounding box together with the `t` values where the 3 | * bounds on the bezier are reached. 4 | * 5 | * @param ps an order 1,2 or 3 bezier curve given as an array of its control 6 | * points, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 7 | * 8 | * @doc mdx 9 | */ 10 | declare function getBounds(ps: number[][]): { 11 | ts: number[][]; 12 | box: number[][]; 13 | }; 14 | export { getBounds }; 15 | -------------------------------------------------------------------------------- /node/global-properties/bounds/get-control-point-box.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a tight axis-aligned bounding box of the given bezier curve's control 3 | * points. (Note that the box is not a tight bound of the bezier curve itself.) 4 | * 5 | * @param ps an order 1,2 or 3 bezier curve given as an ordered array of its 6 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 7 | * 8 | * @doc mdx 9 | */ 10 | declare function getControlPointBox(ps: number[][]): number[][]; 11 | export { getControlPointBox }; 12 | -------------------------------------------------------------------------------- /node/global-properties/bounds/get-interval-box/get-interval-box.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns an axis-aligned-box that is guaranteed to engulf the entire 3 | * given bezier curve from t1 to t2. The returned box is given as a pair 4 | * of points (the box corners) in double precision, e.g. `[[1,1], [2,2]]`. 5 | * 6 | * * **precondition:** (to satisfy guarantee) t1 < t2 7 | * * **precondition:** (to satisfy guarantee) t1,t2 >= 0 && t1,t2 <= 1 8 | * 9 | * @param ps an order 1,2 or 3 bezier curve given as an array of its control 10 | * points, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 11 | * @param ts [first, second] parameter values, e.g. [0.11, 0.12] 12 | * 13 | * @doc mdx 14 | */ 15 | declare function getIntervalBox(ps: number[][], ts: number[]): number[][]; 16 | export { getIntervalBox }; 17 | -------------------------------------------------------------------------------- /node/global-properties/bounds/get-x-bounds-tight.d.ts: -------------------------------------------------------------------------------- 1 | import { XBounds } from "./bounds.js"; 2 | /** 3 | * Returns tight x-coordinate bounds of the given bezier curve. 4 | * 5 | * @param ps an order 1, 2 or 3 bezier curve given as an array of control 6 | * points, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 7 | * 8 | * @doc mdx 9 | */ 10 | declare function getXBoundsTight(ps: number[][]): XBounds; 11 | export { getXBoundsTight }; 12 | -------------------------------------------------------------------------------- /node/global-properties/bounds/get-y-bounds-tight.d.ts: -------------------------------------------------------------------------------- 1 | import { YBounds } from "./bounds.js"; 2 | /** 3 | * Returns tight y-coordinate bounds of the given bezier curve. 4 | * 5 | * @param ps an order 1, 2 or 3 bezier curve given as an array of control 6 | * points, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 7 | * 8 | * @doc mdx 9 | */ 10 | declare function getYBoundsTight(ps: number[][]): YBounds; 11 | export { getYBoundsTight }; 12 | -------------------------------------------------------------------------------- /node/global-properties/classification/is-cubic-really-line.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the given bezier curve has all control points collinear 3 | * *and* it can be converted to an order 1 bezier curve (a line) such that the 4 | * same `(x,y)` point is returned for the same `t` value, `false` otherwise. 5 | * 6 | * * **exact**: not susceptible to floating point round-off 7 | * 8 | * @param ps a cubic bezier curve given as an array of its control 9 | * points, e.g. `[[1,2],[3,4],[5,6],[7,8]]` 10 | * 11 | * @doc mdx 12 | */ 13 | declare function isCubicReallyLine(ps: number[][]): boolean; 14 | export { isCubicReallyLine }; 15 | -------------------------------------------------------------------------------- /node/global-properties/classification/is-cubic-really-quad.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the given cubic bezier curve is really a quadratic (or 3 | * lower order) curve in disguise, i.e. it can be represent by a quadratic 4 | * bezier curve, `false` otherwise. 5 | * 6 | * * **exact**: not susceptible to floating point round-off 7 | * 8 | * @param ps an order 0,1,2 or 3 bezier curve given as an array of its control 9 | * points, e.g. `[[1,2],[3,4],[5,6],[7,8]]` 10 | * 11 | * @doc mdx 12 | */ 13 | declare function isCubicReallyQuad(ps: number[][]): boolean; 14 | export { isCubicReallyQuad }; 15 | -------------------------------------------------------------------------------- /node/global-properties/classification/is-quad-flat.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the given quadratic bezier curve is acute (see `isQuadObtuse`) 3 | * and can be approximated with a line segment with maximum Hausdorff distance 4 | * <= the given tolerance, `false` otherwise. 5 | * 6 | * @param ps a quadratic bezier curve given as an array of its control 7 | * points, e.g. `[[1,2],[3,4],[5,6]]` 8 | * @param tolerance a maximum Hausdorff distance tolerance; defaults to `2**-10` 9 | * of the maximum coordinate of the given bezier curve 10 | * 11 | * @internal 12 | */ 13 | declare function isQuadFlat(ps: number[][], tolerance?: number | undefined): boolean; 14 | export { isQuadFlat }; 15 | -------------------------------------------------------------------------------- /node/global-properties/classification/is-quad-obtuse.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the given quadratic bezier is obtuse, `false` otherwise (i.e. 3 | * `false` if acute). 4 | * 5 | * Obtuse here is defined as follows: let the quad form a triangle through its 6 | * control points P0, P1, P2 where P0 and P2 are the endpoints. If both interior 7 | * angles ∠P0 and ∠P2 are <= 90 degrees then the quad is considered acute, 8 | * otherwise it is considered obtuse. 9 | * 10 | * @doc mdx 11 | */ 12 | declare function isQuadObtuse(ps: number[][]): boolean; 13 | export { isQuadObtuse }; 14 | -------------------------------------------------------------------------------- /node/global-properties/classification/is-quad-obtuse.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"is-quad-obtuse.js","sourceRoot":"","sources":["../../../src/global-properties/classification/is-quad-obtuse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGzD;;;;;;;;;;GAUG;AACH,SAAS,YAAY,CAAC,EAAc;IAChC,MAAM,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpC,MAAM,aAAa,GAAG,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IAEtC,OAAO,aAAa,IAAI,aAAa,CAAC;AAC1C,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/global-properties/classification/is-quad-really-line.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the given quadratic bezier curve is really a linear curve 3 | * (or a point), i.e. if all control points collinear *and* it can be converted 4 | * to an order 1 bezier curve (a line) such that the 5 | * same `(x,y)` point is returned for the same `t` value, `false` otherwise. 6 | * 7 | * * the required condition is met if: `x0 + x2 = 2*x1` and `y0 + y2 = 2*y1` 8 | * * **exact**: not susceptible to floating point round-off 9 | * 10 | * @param ps a quadratic bezier curve given as an array of its control 11 | * points, e.g. `[[1,2],[5,6],[7,8]]` 12 | * 13 | * @doc mdx 14 | */ 15 | declare function isQuadReallyLine(ps: number[][]): boolean; 16 | export { isQuadReallyLine }; 17 | -------------------------------------------------------------------------------- /node/global-properties/classification/is-really-point.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the given bezier curve has all control points coincident, 3 | * `false` otherwise. 4 | * 5 | * @param ps an order 0,1,2 or 3 bezier curve given as an array of its control 6 | * points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 7 | * 8 | * @doc 9 | */ 10 | declare function isReallyPoint(ps: number[][]): boolean; 11 | export { isReallyPoint }; 12 | -------------------------------------------------------------------------------- /node/global-properties/classification/is-really-point.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the given bezier curve has all control points coincident, 3 | * `false` otherwise. 4 | * 5 | * @param ps an order 0,1,2 or 3 bezier curve given as an array of its control 6 | * points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 7 | * 8 | * @doc 9 | */ 10 | function isReallyPoint(ps) { 11 | const x = ps[0][0]; 12 | const y = ps[0][1]; 13 | for (let i = 1; i < ps.length; i++) { 14 | if (x !== ps[i][0] || y !== ps[i][1]) { 15 | return false; 16 | } 17 | } 18 | return true; 19 | } 20 | export { isReallyPoint }; 21 | //# sourceMappingURL=is-really-point.js.map -------------------------------------------------------------------------------- /node/global-properties/classification/is-really-point.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"is-really-point.js","sourceRoot":"","sources":["../../../src/global-properties/classification/is-really-point.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,SAAS,aAAa,CAAC,EAAc;IACjC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACnC,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/global-properties/classification/is-self-overlapping.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the given bezier has all control points collinear and 3 | * it is self-overlapping, i.e. if it intersects itself at an infinite number 4 | * of points. 5 | * 6 | * * a bezier curve can only intersect itself at an infinite number of 7 | * points if its locus is a 'self-overlapping line'. 8 | * 9 | * @param ps an order 0,1,2 or 3 bezier curve given as an array of its control 10 | * points, e.g. `[[1,2],[3,4],[5,6],[7,8]]` 11 | * 12 | * @doc mdx 13 | */ 14 | declare function isSelfOverlapping(ps: number[][]): boolean; 15 | export { isSelfOverlapping }; 16 | -------------------------------------------------------------------------------- /node/global-properties/get-bending-energy.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns an accurate approximation of the bending energy of the given bezier 3 | * curve. 4 | * 5 | * @param maxCurviness defaults to 1.125 6 | * @param gaussOrder defaults to 4 7 | * @param ps a cubic bezier curve given by an ordered array of its 8 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 9 | * 10 | * @doc mdx 11 | */ 12 | declare function getBendingEnergy(ps: number[][], maxCurviness?: number, gaussOrder?: 4 | 16 | 64): number; 13 | export { getBendingEnergy }; 14 | -------------------------------------------------------------------------------- /node/global-properties/get-inflections.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the given order 1,2 or 3 bezier curve's inflection point `t` 3 | * parameter values in ascending order. 4 | * 5 | * * see [Caffeine Owl](http://www.caffeineowl.com/graphics/2d/vectorial/cubic-inflexion.html) 6 | * 7 | * @param ps an order 0,1,2 or 3 bezier curve given as an array of its control 8 | * points, e.g. `[[1,2],[3,4],[5,6],[7,8]]` 9 | * 10 | * @doc mdx 11 | */ 12 | declare function getInflections(ps: number[][]): number[]; 13 | export { getInflections }; 14 | -------------------------------------------------------------------------------- /node/global-properties/length/control-point-lines-length.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns an upper bound for the length of the given bezier curve - this bound 3 | * is not very strict as it uses the sum of the straight-line distances between 4 | * control points as a measure. 5 | * 6 | * @param ps an order 0,1,2 or 3 bezier curve given as an array of its control 7 | * points, e.g. `[[1,2],[3,4],[5,6],[7,8]]` 8 | * 9 | * @doc mdx 10 | */ 11 | declare function controlPointLinesLength(ps: number[][]): number; 12 | export { controlPointLinesLength }; 13 | -------------------------------------------------------------------------------- /node/global-properties/length/control-point-lines-length.js: -------------------------------------------------------------------------------- 1 | import { distanceBetween } from "flo-vector2d"; 2 | /** 3 | * Returns an upper bound for the length of the given bezier curve - this bound 4 | * is not very strict as it uses the sum of the straight-line distances between 5 | * control points as a measure. 6 | * 7 | * @param ps an order 0,1,2 or 3 bezier curve given as an array of its control 8 | * points, e.g. `[[1,2],[3,4],[5,6],[7,8]]` 9 | * 10 | * @doc mdx 11 | */ 12 | function controlPointLinesLength(ps) { 13 | let totalLength = 0; 14 | for (let i = 0; i < ps.length - 1; i++) { 15 | totalLength += distanceBetween(ps[i], ps[i + 1]); 16 | } 17 | return totalLength; 18 | } 19 | export { controlPointLinesLength }; 20 | //# sourceMappingURL=control-point-lines-length.js.map -------------------------------------------------------------------------------- /node/global-properties/length/control-point-lines-length.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"control-point-lines-length.js","sourceRoot":"","sources":["../../../src/global-properties/length/control-point-lines-length.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;;GASG;AACH,SAAS,uBAAuB,CAAC,EAAc;IAC3C,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,EAAE,CAAC,MAAM,GAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,WAAW,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,WAAW,CAAC;AACvB,CAAC;AAGD,OAAO,EAAE,uBAAuB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/global-properties/length/length-bez1.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the curve length of the given line within the specified parameter 3 | * interval. 4 | * 5 | * @param interval the paramter interval over which the length is 6 | * to be calculated (often `[0,1]`) 7 | * @param ps a linear bezier curve given by an ordered array of its control 8 | * points, e.g. `[[0,0],[1,1]]` 9 | * 10 | * @internal 11 | */ 12 | declare function lengthBez1(interval: number[], ps: number[][]): number; 13 | export { lengthBez1 }; 14 | -------------------------------------------------------------------------------- /node/global-properties/length/length-bez1.js: -------------------------------------------------------------------------------- 1 | import { distanceBetween } from "flo-vector2d"; 2 | /** 3 | * Returns the curve length of the given line within the specified parameter 4 | * interval. 5 | * 6 | * @param interval the paramter interval over which the length is 7 | * to be calculated (often `[0,1]`) 8 | * @param ps a linear bezier curve given by an ordered array of its control 9 | * points, e.g. `[[0,0],[1,1]]` 10 | * 11 | * @internal 12 | */ 13 | function lengthBez1(interval, ps) { 14 | const [t1, t2] = interval; 15 | const [[x0, y0], [x1, y1]] = ps; 16 | const p1 = [x0 + t1 * (x1 - x0), y0 + t1 * (y1 - y0)]; 17 | const p2 = [x0 + t2 * (x1 - x0), y0 + t2 * (y1 - y0)]; 18 | return distanceBetween(p1, p2); 19 | } 20 | export { lengthBez1 }; 21 | //# sourceMappingURL=length-bez1.js.map -------------------------------------------------------------------------------- /node/global-properties/length/length-bez1.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"length-bez1.js","sourceRoot":"","sources":["../../../src/global-properties/length/length-bez1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;;;GAUG;AACF,SAAS,UAAU,CAClB,QAAkB,EAClB,EAAc;IAEf,MAAM,CAAC,EAAE,EAAC,EAAE,CAAC,GAAG,QAAQ,CAAC;IAEzB,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;IAEhC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAClD,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAElD,OAAO,eAAe,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AAC/B,CAAC;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/global-properties/length/length.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"length.js","sourceRoot":"","sources":["../../../src/global-properties/length/length.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,MAAM,CACb,QAAkB,EAClB,EAAc,EACd,YAAY,GAAG,GAAG,EAClB,aAAsB,EAAE;IAEzB,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,UAAU,CAAC,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,UAAU,CAAC,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC;IACV,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;AAClE,CAAC;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/implicit-form/double-double/get-implicit-form1-dd.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a double-double precision implicit form of the given 3 | * linear bezier curve. 4 | * 5 | * Returned coefficients are subscripted to match their monomial's variables, 6 | * e.g. `vₓᵧ` is the coefficient of the monomial `vₓᵧxy` 7 | * 8 | * * the implicit form is given by: `vₓx + vᵧy + v = 0` 9 | * * intermediate calculations are performed in double-double precision 10 | * * adapted from [Indrek Mandre](http://www.mare.ee/indrek/misc/2d.pdf) 11 | * 12 | * @param ps a line segment given as an array of its control points, 13 | * e.g. `[[1,2],[3,4]]` 14 | * 15 | * @doc mdx 16 | */ 17 | declare function getImplicitForm1Dd(ps: number[][]): { 18 | vₓ: number[]; 19 | vᵧ: number[]; 20 | v: number[]; 21 | }; 22 | export { getImplicitForm1Dd }; 23 | -------------------------------------------------------------------------------- /node/implicit-form/double/get-implicit-form1.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the implicit form of the given linear bezier curve, i.e. line 3 | * segment. 4 | * 5 | * * returned coefficients are subscripted to match their monomial's variables, 6 | * e.g. `vₓᵧ` is the coefficient of the monomial `vₓᵧxy` 7 | * * the implicit form is given by: `vₓx + vᵧy + v = 0` 8 | * * intermediate calculations are done in **double** precision 9 | * * adapted from [Indrek Mandre](http://www.mare.ee/indrek/misc/2d.pdf) 10 | * 11 | * @param ps a line segment given as an array of its control points, 12 | * e.g. `[[1,2],[3,4]]` 13 | * 14 | * @doc mdx 15 | */ 16 | declare function getImplicitForm1(ps: number[][]): { 17 | vₓ: number; 18 | vᵧ: number; 19 | v: number; 20 | }; 21 | export { getImplicitForm1 }; 22 | -------------------------------------------------------------------------------- /node/implicit-form/double/get-implicit-form1.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"get-implicit-form1.js","sourceRoot":"","sources":["../../../src/implicit-form/double/get-implicit-form1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAG7F;;;;;;;;;;;;;;GAcG;AACH,SAAS,gBAAgB,CACjB,EAAc;IAElB,iCAAiC;IACjC,oBAAoB;IAEpB,MAAM,CAAC,CAAC,EAAE,EAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IAE7C,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IACf,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,MAAM,CAAC,GAAG,EAAE,GAAC,EAAE,GAAG,EAAE,GAAC,EAAE,CAAC;IAExB,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;AACzB,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/implicit-form/double/get-implicit-form2.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the implicit form of the given quadratic bezier curve. 3 | * 4 | * * returned coefficients are subscripted to match their monomial's variables, 5 | * e.g. `vₓᵧ` is the coefficient of the monomial `vₓᵧxy` 6 | * * the implicit form is given by: `vₓₓx² +vₓᵧxy + vᵧᵧy² + vₓx + vᵧy + v = 0` 7 | * * intermediate calculations are done in **double** precision 8 | * * adapted from [Indrek Mandre](http://www.mare.ee/indrek/misc/2d.pdf) 9 | * 10 | * @param ps a quadratic bezier curve given as an array of its control points, 11 | * e.g. `[[1,2],[3,4],[5,7]]` 12 | * 13 | * @doc mdx 14 | */ 15 | declare function getImplicitForm2(ps: number[][]): { 16 | vₓₓ: number; 17 | vₓᵧ: number; 18 | vᵧᵧ: number; 19 | vₓ: number; 20 | vᵧ: number; 21 | v: number; 22 | }; 23 | export { getImplicitForm2 }; 24 | -------------------------------------------------------------------------------- /node/implicit-form/evaluate/double/evaluate-implicit1.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Evaluates and returns the result of evaluating the given implicit function 3 | * (a degree 1 bivariate polynomial in `x` and `y`) at the point `[x,y]`. 4 | * 5 | * * the implicit form is given by: `vₓ*x + vᵧ*y + v`, where the `vₓ`, `vₓ`, `v`, 6 | * etc are constants 7 | * 8 | * @example 9 | * ```typescript 10 | * evaluateImplicit1({ vₓ: 1, vᵧ: 2, v: 3 }, 1, 1); //=> 6 11 | * ``` 12 | * 13 | * @param cs the polynomial to evaluate 14 | * @param x the `x` variable at which to evaluate 15 | * @param y the `y` variable at which to evaluate 16 | * 17 | * @doc 18 | */ 19 | declare function evaluateImplicit1(cs: { 20 | vₓ: number; 21 | vᵧ: number; 22 | v: number; 23 | }, x: number, y: number): number; 24 | export { evaluateImplicit1 }; 25 | -------------------------------------------------------------------------------- /node/implicit-form/evaluate/double/evaluate-implicit1.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Evaluates and returns the result of evaluating the given implicit function 3 | * (a degree 1 bivariate polynomial in `x` and `y`) at the point `[x,y]`. 4 | * 5 | * * the implicit form is given by: `vₓ*x + vᵧ*y + v`, where the `vₓ`, `vₓ`, `v`, 6 | * etc are constants 7 | * 8 | * @example 9 | * ```typescript 10 | * evaluateImplicit1({ vₓ: 1, vᵧ: 2, v: 3 }, 1, 1); //=> 6 11 | * ``` 12 | * 13 | * @param cs the polynomial to evaluate 14 | * @param x the `x` variable at which to evaluate 15 | * @param y the `y` variable at which to evaluate 16 | * 17 | * @doc 18 | */ 19 | function evaluateImplicit1(cs, x, y) { 20 | const { vₓ, vᵧ, v } = cs; 21 | return vₓ * x + vᵧ * y + v; 22 | } 23 | export { evaluateImplicit1 }; 24 | //# sourceMappingURL=evaluate-implicit1.js.map -------------------------------------------------------------------------------- /node/implicit-form/evaluate/double/evaluate-implicit1.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"evaluate-implicit1.js","sourceRoot":"","sources":["../../../../src/implicit-form/evaluate/double/evaluate-implicit1.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,iBAAiB,CAClB,EAA0C,EAC1C,CAAS,EACT,CAAS;IAEb,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IAEzB,OAAO,EAAE,GAAC,CAAC,GAAG,EAAE,GAAC,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/implicit-form/evaluate/double/evaluate-implicit2.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"evaluate-implicit2.js","sourceRoot":"","sources":["../../../../src/implicit-form/evaluate/double/evaluate-implicit2.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,iBAAiB,CAClB,EAGC,EACD,CAAS,EACT,CAAS;IAEb,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IAExC,OAAO,GAAG,GAAC,CAAC,GAAC,CAAC,GAAG,GAAG,GAAC,CAAC,GAAC,CAAC,GAAG,GAAG,GAAC,CAAC,GAAC,CAAC,GAAG,EAAE,GAAC,CAAC,GAAG,EAAE,GAAC,CAAC,GAAG,CAAC,CAAC;AACzD,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/implicit-form/evaluate/double/evaluate-implicit3.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"evaluate-implicit3.js","sourceRoot":"","sources":["../../../../src/implicit-form/evaluate/double/evaluate-implicit3.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAS,iBAAiB,CAClB,EAIC,EACD,CAAS,EACT,CAAS;IAEb,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IAEhE,OAAO,CACH,IAAI,GAAC,CAAC,GAAC,CAAC,GAAC,CAAC;QACV,IAAI,GAAC,CAAC,GAAC,CAAC,GAAC,CAAC;QACV,IAAI,GAAC,CAAC,GAAC,CAAC,GAAC,CAAC;QACV,IAAI,GAAC,CAAC,GAAC,CAAC,GAAC,CAAC;QACV,GAAG,GAAC,CAAC,GAAC,CAAC;QACP,GAAG,GAAC,CAAC,GAAC,CAAC;QACP,GAAG,GAAC,CAAC,GAAC,CAAC;QACP,EAAE,GAAC,CAAC;QACJ,EAAE,GAAC,CAAC;QACJ,CAAC,CACJ,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/implicit-form/implicit-form-types.js: -------------------------------------------------------------------------------- 1 | // types only, import as `import type { ... } ...` 2 | export {}; 3 | //# sourceMappingURL=implicit-form-types.js.map -------------------------------------------------------------------------------- /node/implicit-form/implicit-form-types.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"implicit-form-types.js","sourceRoot":"","sources":["../../src/implicit-form/implicit-form-types.ts"],"names":[],"mappings":"AAAA,kDAAkD"} -------------------------------------------------------------------------------- /node/intersection/bezier-bezier-intersection-fast/check-intersection-in-ranges.d.ts: -------------------------------------------------------------------------------- 1 | import type { Iteration } from './iteration.js'; 2 | /** 3 | * Returns 0, 1 or 2 new narrowed ranges of possible intersections based on the 4 | * given current iteration's ranges. 5 | * 6 | * * helper function to the geometric interval bezier-bezier intersection 7 | * algorithm 8 | * 9 | * @param iter 10 | * 11 | * @internal 12 | */ 13 | declare function checkIntersectionInRanges(iter: Iteration): Iteration[]; 14 | export { checkIntersectionInRanges }; 15 | -------------------------------------------------------------------------------- /node/intersection/bezier-bezier-intersection-fast/debug.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=debug.js.map -------------------------------------------------------------------------------- /node/intersection/bezier-bezier-intersection-fast/debug.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/intersection/bezier-bezier-intersection-fast/debug.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node/intersection/bezier-bezier-intersection-fast/get-distance-to-line-function.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @param pS 3 | * @param pE 4 | * 5 | * @internal 6 | */ 7 | declare function getDistanceToLineFunction(pS: number[], pE: number[]): (p: number[], _p: number[]) => { 8 | dMin: number; 9 | dMax: number; 10 | }; 11 | export { getDistanceToLineFunction }; 12 | -------------------------------------------------------------------------------- /node/intersection/bezier-bezier-intersection-fast/iteration.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=iteration.js.map -------------------------------------------------------------------------------- /node/intersection/bezier-bezier-intersection-fast/iteration.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"iteration.js","sourceRoot":"","sources":["../../../src/intersection/bezier-bezier-intersection-fast/iteration.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node/intersection/bezier-bezier-intersection/bezier-bezier-intersection-boundless.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"bezier-bezier-intersection-boundless.js","sourceRoot":"","sources":["../../../src/intersection/bezier-bezier-intersection/bezier-bezier-intersection-boundless.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAO,0CAA0C,CAAC;AAG5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,iCAAiC,CAClC,GAAe,EACf,GAAe;IAEnB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC,GAAG,EAAC,GAAG,CAAC,CAAC;IAEjE,OAAO,iBAAiB,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AACtE,CAAC;AAGD,OAAO,EAAE,iCAAiC,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/bezier-bezier-intersection/x.js: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | function getPFromBox(box) { 3 | const tl = box[0]; 4 | const br = box[1]; 5 | return [ 6 | (tl[0] + br[0]) / 2, 7 | (tl[1] + br[1]) / 2, 8 | ]; 9 | } 10 | export { getPFromBox }; 11 | //# sourceMappingURL=x.js.map -------------------------------------------------------------------------------- /node/intersection/bezier-bezier-intersection/x.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"x.js","sourceRoot":"","sources":["../../../src/intersection/bezier-bezier-intersection/x.ts"],"names":[],"mappings":"AAgEA,gBAAgB;AAChB,SAAS,WAAW,CAAC,GAAe;IAChC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAClB,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAElB,OAAO;QACH,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC;QACjB,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC;KACpB,CAAC;AACN,CAAC;AAGD,OAAO,EAAK,WAAW,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/b-abs.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function bAbs(n: bigint): bigint; 3 | export { bAbs }; 4 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/b-abs.js: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | function bAbs(n) { 3 | return n < 0n ? -n : n; 4 | } 5 | export { bAbs }; 6 | //# sourceMappingURL=b-abs.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/b-abs.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"b-abs.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/b-abs.ts"],"names":[],"mappings":"AACA,gBAAgB;AAChB,SAAS,IAAI,CAAC,CAAS;IACnB,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC;AAGD,OAAO,EAAE,IAAI,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/b-cbrt.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the cube root of a bigint. 3 | * 4 | * * see https://stackoverflow.com/a/53684036/2010061 5 | * 6 | * * **precondition**: the given bigint must be a perfect cube 7 | * 8 | * @internal 9 | */ 10 | declare function bCbrt(n: bigint): bigint; 11 | export { bCbrt }; 12 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/b-cbrt.js: -------------------------------------------------------------------------------- 1 | import { bAbs } from './b-abs.js'; 2 | import { bSign } from './b-sign.js'; 3 | const { round, cbrt } = Math; 4 | /** 5 | * Returns the cube root of a bigint. 6 | * 7 | * * see https://stackoverflow.com/a/53684036/2010061 8 | * 9 | * * **precondition**: the given bigint must be a perfect cube 10 | * 11 | * @internal 12 | */ 13 | function bCbrt(n) { 14 | const sgn = bSign(n); 15 | n = bAbs(n); 16 | if (n <= 1n) { 17 | return sgn * n; 18 | } 19 | let x0 = BigInt(round(cbrt(Number(n)))); 20 | while (true) { 21 | const x1 = (2n * x0 + n / (x0 * x0)) / 3n; 22 | if (x1 === x0) { 23 | return sgn * x0; 24 | } 25 | x0 = x1; 26 | } 27 | } 28 | export { bCbrt }; 29 | //# sourceMappingURL=b-cbrt.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/b-sign.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function bSign(v: bigint): bigint; 3 | export { bSign }; 4 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/b-sign.js: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | function bSign(v) { 3 | return v > 0n ? 1n : v < 0n ? -1n : 0n; 4 | } 5 | export { bSign }; 6 | //# sourceMappingURL=b-sign.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/b-sign.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"b-sign.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/b-sign.ts"],"names":[],"mappings":"AACA,gBAAgB;AAChB,SAAS,KAAK,CAAC,CAAS;IACpB,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3C,CAAC;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/b-sqrt.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the square root of a bigint. 3 | * 4 | * * see https://stackoverflow.com/a/53684036/2010061 5 | * 6 | * * **precondition**: the given bigint must be a perfect square 7 | * 8 | * @internal 9 | */ 10 | declare function bSqrt(v: bigint): bigint; 11 | export { bSqrt }; 12 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/b-sqrt.js: -------------------------------------------------------------------------------- 1 | const { round, sqrt } = Math; 2 | /** 3 | * Returns the square root of a bigint. 4 | * 5 | * * see https://stackoverflow.com/a/53684036/2010061 6 | * 7 | * * **precondition**: the given bigint must be a perfect square 8 | * 9 | * @internal 10 | */ 11 | function bSqrt(v) { 12 | if (v <= 1n) { 13 | if (v < 0n) { 14 | throw new Error('square root of negative numbers are not allowed'); 15 | } 16 | return v; 17 | } 18 | let x0 = BigInt(round(sqrt(Number(v)))); 19 | while (true) { 20 | const x1 = (x0 + v / x0) >> 1n; 21 | if (x1 === x0) { 22 | return x0; 23 | } 24 | x0 = x1; 25 | } 26 | } 27 | export { bSqrt }; 28 | //# sourceMappingURL=b-sqrt.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/b-sqrt.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"b-sqrt.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/b-sqrt.ts"],"names":[],"mappings":"AACA,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;AAG7B;;;;;;;;GAQG;AACF,SAAS,KAAK,CAAC,CAAS;IACrB,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;QACV,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACvE,CAAC;QACD,OAAO,CAAC,CAAC;IACb,CAAC;IAED,IAAI,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAExC,OAAO,IAAI,EAAE,CAAC;QACV,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,GAAC,EAAE,CAAC,IAAI,EAAE,CAAC;QAC7B,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC;QACd,CAAC;QACD,EAAE,GAAG,EAAE,CAAC;IACZ,CAAC;AACL,CAAC;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/bigint-to-expansion.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf) expansion of the given bigint. 3 | * 4 | * * it is assumed that the given bigint doesn't cause floating point overflow 5 | * 6 | * @internal 7 | */ 8 | declare function bigintToExpansion(b: bigint): number[]; 9 | export { bigintToExpansion }; 10 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/bigint-to-expansion.js: -------------------------------------------------------------------------------- 1 | import { eCompress } from "big-float-ts"; 2 | const maxSafe = BigInt(2 ** 53); 3 | /** 4 | * Returns the [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf) expansion of the given bigint. 5 | * 6 | * * it is assumed that the given bigint doesn't cause floating point overflow 7 | * 8 | * @internal 9 | */ 10 | function bigintToExpansion(b) { 11 | if (b === 0n) { 12 | return [0]; 13 | } 14 | const e = []; 15 | let i = 0; 16 | let q = b; 17 | while (q !== 0n) { 18 | q = b / maxSafe; 19 | const r = b % maxSafe; 20 | e.push(Number(r) * 2 ** (i * 53)); 21 | b = q; 22 | i++; 23 | } 24 | return eCompress(e); 25 | } 26 | export { bigintToExpansion }; 27 | //# sourceMappingURL=bigint-to-expansion.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/bigint-to-expansion.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"bigint-to-expansion.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/bigint-to-expansion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,IAAE,EAAE,CAAC,CAAC;AAC9B;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,CAAS;IAChC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;QAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAAC,CAAC;IAC7B,MAAM,CAAC,GAAa,EAAE,CAAC;IACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;QACd,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QAChB,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;QACtB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAC,CAAC,IAAE,CAAC,CAAC,GAAC,EAAE,CAAC,CAAC,CAAC;QAC5B,CAAC,GAAG,CAAC,CAAC;QACN,CAAC,EAAE,CAAC;IACR,CAAC;IAED,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;AACxB,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/calc-exact-cube-root.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * * **precondition**: the given value must be a perfect cube 3 | * 4 | * @param a the rational value for which the square root is sought given as 5 | * `[N,D]` to represent the value `N/D` where `N` and `D` are [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf) 6 | * expansions 7 | * 8 | * @internal 9 | */ 10 | declare function calcExactCubeRoot(a: number[][]): number[][]; 11 | export { calcExactCubeRoot }; 12 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/calc-exact-cube-root.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"calc-exact-cube-root.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/calc-exact-cube-root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C;;;;;;;;GAQG;AACF,SAAS,iBAAiB,CAAC,CAAa;IACrC,MAAM,CAAC,EAAE,EAAC,EAAE,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAE1D,MAAM,GAAG,GAAG,OAAO,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;IAE3B,uEAAuE;IACvE,wGAAwG;IACxG,MAAM,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,EAAE,GAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,MAAM,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,EAAE,GAAC,GAAG,CAAC,CAAC,CAAC;IAE3C,OAAO,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;AACjB,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/calc-exact-square-root.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * * **precondition**: the given value must be a perfect square 3 | * 4 | * @param a the rational value for which the square root is sought given as 5 | * `[N,D]` to represent the value `N/D` where `N` and `D` are [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf) 6 | * expansions 7 | * 8 | * @internal 9 | */ 10 | declare function calcExactSquareRoot(a: number[][]): number[][]; 11 | export { calcExactSquareRoot }; 12 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/ensure-range.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @param t 3 | * @param min1Sign 4 | * 5 | * @internal 6 | */ 7 | declare function ensureRange(t: number, min1Sign: number): number; 8 | export { ensureRange }; 9 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/ensure-range.js: -------------------------------------------------------------------------------- 1 | const eps = Number.EPSILON; 2 | const u = eps / 2; 3 | /** 4 | * @param t 5 | * @param min1Sign 6 | * 7 | * @internal 8 | */ 9 | function ensureRange(t, min1Sign) { 10 | return (min1Sign < 0 11 | ? (t < 1 ? t : 1 - u) 12 | : min1Sign === 0 13 | ? 1 14 | : (t > 1 ? t : 1 + eps)); 15 | } 16 | export { ensureRange }; 17 | //# sourceMappingURL=ensure-range.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/ensure-range.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"ensure-range.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/ensure-range.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC;AAC3B,MAAM,CAAC,GAAG,GAAG,GAAC,CAAC,CAAC;AAGhB;;;;;GAKG;AACF,SAAS,WAAW,CACb,CAAS,EACT,QAAgB;IAEpB,OAAO,CACD,QAAQ,GAAG,CAAC;QACd,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC,CAAC,QAAQ,KAAK,CAAC;YAChB,CAAC,CAAC,CAAC;YACH,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAC1B,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/er-compare.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Compares two expansion rationals. 3 | * 4 | * @internal 5 | */ 6 | declare function erCompare(a: number[][], b: number[][]): number; 7 | export { erCompare }; 8 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/er-compare.js: -------------------------------------------------------------------------------- 1 | import { eCompare, eMult, eSign } from "big-float-ts"; 2 | /** 3 | * Compares two expansion rationals. 4 | * 5 | * @internal 6 | */ 7 | function erCompare(a, b) { 8 | return (eCompare(eMult(a[0], b[1]), eMult(a[1], b[0])) * 9 | eSign(a[1]) * 10 | eSign(b[1])); 11 | } 12 | export { erCompare }; 13 | //# sourceMappingURL=er-compare.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/er-compare.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"er-compare.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/er-compare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGtD;;;;GAIG;AACF,SAAS,SAAS,CAAC,CAAa,EAAE,CAAa;IAC5C,OAAO,CACH,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5C,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACX,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACd,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/er-estimate.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Estimates the result of the given expansion rational. 3 | * 4 | * * the sign of the returned result is guaranteed to be correct 5 | * * the result is guaranteed accurate to within 2 ulps 6 | * 7 | * @param a 8 | * 9 | * @internal 10 | */ 11 | declare function erEstimate(a: number[][]): number; 12 | export { erEstimate }; 13 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/er-estimate.js: -------------------------------------------------------------------------------- 1 | import { eDiv, eEstimate } from "big-float-ts"; 2 | /** 3 | * Estimates the result of the given expansion rational. 4 | * 5 | * * the sign of the returned result is guaranteed to be correct 6 | * * the result is guaranteed accurate to within 2 ulps 7 | * 8 | * @param a 9 | * 10 | * @internal 11 | */ 12 | function erEstimate(a) { 13 | return eEstimate(eDiv(a[0], a[1], 2)); 14 | } 15 | export { erEstimate }; 16 | //# sourceMappingURL=er-estimate.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/er-estimate.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"er-estimate.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/er-estimate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;;;;GASG;AACH,SAAS,UAAU,CAAC,CAAa;IAC7B,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/er-sign.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the sign of the given expansion rational. 3 | * 4 | * @param a 5 | * 6 | * @internal 7 | */ 8 | declare function erSign(a: number[][]): number; 9 | export { erSign }; 10 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/er-sign.js: -------------------------------------------------------------------------------- 1 | import { eSign } from "big-float-ts"; 2 | /** 3 | * Returns the sign of the given expansion rational. 4 | * 5 | * @param a 6 | * 7 | * @internal 8 | */ 9 | function erSign(a) { 10 | return eSign(a[0]) * eSign(a[1]); 11 | } 12 | export { erSign }; 13 | //# sourceMappingURL=er-sign.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/er-sign.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"er-sign.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/er-sign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC;;;;;;GAMG;AACH,SAAS,MAAM,CAAC,CAAa;IACzB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/get-ab.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function getAB(getTransform: (xyA: number[][][], xyB: number[][][]) => number[][]): (psA: number[][], psB: number[][]) => number[]; 3 | export { getAB }; 4 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/get-ab1.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare const getAB1: (psA: number[][], psB: number[][]) => number[]; 3 | export { getAB1 }; 4 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/get-ab1.js: -------------------------------------------------------------------------------- 1 | import { getAB } from "./get-ab.js"; 2 | import { getTransform1 } from "./get-transform-1.js"; 3 | /** @internal */ 4 | const getAB1 = getAB(getTransform1); 5 | export { getAB1 }; 6 | //# sourceMappingURL=get-ab1.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/get-ab1.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"get-ab1.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/get-ab1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,gBAAgB;AAChB,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;AAGpC,OAAO,EAAE,MAAM,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/get-ab2.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function getAB2(psA: number[][], psB: number[][]): number[]; 3 | export { getAB2 }; 4 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/get-ab3.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare const getAB3: (psA: number[][], psB: number[][]) => number[]; 3 | export { getAB3 }; 4 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/get-ab3.js: -------------------------------------------------------------------------------- 1 | import { getAB } from "./get-ab.js"; 2 | import { getTransform3 } from "./get-transform-3.js"; 3 | /** @internal */ 4 | const getAB3 = getAB(getTransform3); 5 | export { getAB3 }; 6 | //# sourceMappingURL=get-ab3.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/get-ab3.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"get-ab3.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/get-ab3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,gBAAgB;AAChB,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;AAGpC,OAAO,EAAE,MAAM,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/get-transform-1.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function getTransform1(_xyA: number[][][], _xyB: number[][][]): number[][]; 3 | export { getTransform1 }; 4 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/get-transform-2.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function getTransform2(xyA: number[][][], xyB: number[][][]): number[][]; 3 | export { getTransform2 }; 4 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/get-transform-3.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function getTransform3(xyA: number[][][], xyB: number[][][]): number[][]; 3 | export { getTransform3 }; 4 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/sum-bigints.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function sumBigints(vs: bigint[]): bigint; 3 | export { sumBigints }; 4 | -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/sum-bigints.js: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | function sumBigints(vs) { 3 | let total = 0n; 4 | for (let i = 0; i < vs.length; i++) { 5 | total += vs[i]; 6 | } 7 | return total; 8 | } 9 | export { sumBigints }; 10 | //# sourceMappingURL=sum-bigints.js.map -------------------------------------------------------------------------------- /node/intersection/get-endpoint-intersections/sum-bigints.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"sum-bigints.js","sourceRoot":"","sources":["../../../src/intersection/get-endpoint-intersections/sum-bigints.ts"],"names":[],"mappings":"AACA,gBAAgB;AAChB,SAAS,UAAU,CAAC,EAAY;IAC5B,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/intersection/self-intersection/get-coefficients/exact/get-coeffs-bez3-exact.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns an error-free polynomial in 1 variable whose roots are the parameter 3 | * values of the self-intersection points of the given cubic bezier curve. 4 | * 5 | * The returned polynomial coefficients are given densely as an array of 6 | * [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf) floating point expansions from highest to lowest power, 7 | * e.g. `[[5],[-3],[0]]` represents the polynomial `5x^2 - 3x`. 8 | * 9 | * * the returned polynomial coefficients are exact (i.e. error-free) 10 | * * adapted from [Indrek Mandre](http://www.mare.ee/indrek/misc/2d.pdf) 11 | * 12 | * @param ps a cubic bezier curve. 13 | * 14 | * @internal 15 | */ 16 | declare function getCoeffsBez3Exact(ps: number[][]): number[][]; 17 | export { getCoeffsBez3Exact }; 18 | -------------------------------------------------------------------------------- /node/local-properties-at-t/dd-curvature.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the curvature `κ` of the given linear, quadratic or cubic bezier 3 | * curve at a specific given parameter value `t`. 4 | * 5 | * * returns `Number.NaN` at a cusp - this can be tested for with `Number.isNaN` 6 | * 7 | * @param ps an order 1,2 or 3 bezier curve, e.g. `[[[0],[0]],[[1],[1]],[[2],[1]],[[2],[0]]]` 8 | * @param t the parameter value where the curvature should be evaluated 9 | */ 10 | declare function ddCurvature(ps: number[][], t: number): number; 11 | export { ddCurvature }; 12 | -------------------------------------------------------------------------------- /node/local-properties-at-t/ds.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `ds` (the length differential) for a linear, quadratic or cubic 3 | * bezier curve. 4 | * 5 | * * this function is curried 6 | * 7 | * @param ps an order 1, 2 or 3 bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 8 | * @param t the parameter value 9 | * 10 | * @internal 11 | */ 12 | declare function ds(ps: number[][]): (t: number) => number; 13 | export { ds }; 14 | -------------------------------------------------------------------------------- /node/local-properties-at-t/ds.js: -------------------------------------------------------------------------------- 1 | import { toPowerBasis_1stDerivative } from "../to-power-basis/to-power-basis-1st-derivative/double/to-power-basis-1st-derivative.js"; 2 | import { Horner } from 'flo-poly'; 3 | /** 4 | * Returns `ds` (the length differential) for a linear, quadratic or cubic 5 | * bezier curve. 6 | * 7 | * * this function is curried 8 | * 9 | * @param ps an order 1, 2 or 3 bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 10 | * @param t the parameter value 11 | * 12 | * @internal 13 | */ 14 | function ds(ps) { 15 | const [dX, dY] = toPowerBasis_1stDerivative(ps); 16 | return function (t) { 17 | const dx = Horner(dX, t); 18 | const dy = Horner(dY, t); 19 | return Math.sqrt(dx * dx + dy * dy); 20 | }; 21 | } 22 | export { ds }; 23 | //# sourceMappingURL=ds.js.map -------------------------------------------------------------------------------- /node/local-properties-at-t/ds.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"ds.js","sourceRoot":"","sources":["../../src/local-properties-at-t/ds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yFAAyF,CAAC;AACrI,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC;;;;;;;;;;GAUG;AACH,SAAS,EAAE,CAAC,EAAc;IACzB,MAAM,CAAC,EAAE,EAAC,EAAE,CAAC,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAC;IAE/C,OAAO,UAAS,CAAS;QACxB,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACzB,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,GAAC,EAAE,GAAG,EAAE,GAAC,EAAE,CAAC,CAAC;IACjC,CAAC,CAAA;AACF,CAAC;AAGD,OAAO,EAAE,EAAE,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/local-properties-at-t/e-curvature.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the curvature `κ` of the given linear, quadratic or cubic bezier 3 | * curve at a specific given parameter value `t`. 4 | * 5 | * * returns `Number.NaN` at a cusp - this can be tested for with `Number.isNaN` 6 | * 7 | * @param ps an order 1,2 or 3 bezier curve, e.g. `[[[0],[0]],[[1],[1]],[[2],[1]],[[2],[0]]]` 8 | * @param t the parameter value where the curvature should be evaluated 9 | */ 10 | declare function eCurvature(ps: number[][], t: number): number; 11 | export { eCurvature }; 12 | -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate-2nd-derivative/double/evaluate-2nd-derivative-at-0.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the result, `[x,y]`, of evaluating the 2nd derivative of a linear, 3 | * quadratic or cubic bezier curve's power basis at `t === 0`. 4 | * 5 | * * uses double precision calculations internally 6 | * 7 | * @param ps An order 0,1,2 or 3 bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 8 | * 9 | * @doc 10 | */ 11 | declare function evaluate2ndDerivativeAt0(ps: number[][]): number[]; 12 | export { evaluate2ndDerivativeAt0 }; 13 | -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate-2nd-derivative/double/evaluate-2nd-derivative-at-1.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the result, `[x,y]`, of evaluating the 2nd derivative of a linear, 3 | * quadratic or cubic bezier curve's power basis at `t === 1`. 4 | * 5 | * * uses double precision calculations internally 6 | * 7 | * @param ps An order 0,1,2 or 3 bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 8 | * 9 | * @doc 10 | */ 11 | declare function evaluate2ndDerivativeAt1(ps: number[][]): number[]; 12 | export { evaluate2ndDerivativeAt1 }; 13 | -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate-2nd-derivative/double/evaluate-2nd-derivative.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the `[x,y]` value of the twice differentiated (with respect to `t`) 3 | * bezier curve's power basis when evaluated at `t`. 4 | * 5 | * * uses double precision calculations internally 6 | * 7 | * @param ps a cubic bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 8 | * @param t the t parameter 9 | * 10 | * @doc mdx 11 | */ 12 | declare function evaluate2ndDerivative(ps: number[][], t: number): number[]; 13 | export { evaluate2ndDerivative }; 14 | -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate-2nd-derivative/double/evaluate-2nd-derivative.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"evaluate-2nd-derivative.js","sourceRoot":"","sources":["../../../../src/local-properties-at-t/evaluate-2nd-derivative/double/evaluate-2nd-derivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+FAA+F,CAAC;AAC3I,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC;;;;;;;;;;GAUG;AACH,SAAS,qBAAqB,CAAC,EAAc,EAAE,CAAS;IACvD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAC;IAEtD,OAAO;QACN,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAChB,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;KAChB,CAAC;AACH,CAAC;AAGD,OAAO,EAAE,qBAAqB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate-2nd-derivative/exact/evaluate-2nd-derivative-at-0-exact.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the *exact* result, `[x,y]`, of evaluating the 2nd derivative of a 3 | * linear, quadratic or cubic bezier curve's power basis at `t === 0`. 4 | * 5 | * @param ps An order 0,1,2 or 3 bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 6 | * 7 | * @doc 8 | */ 9 | declare function evaluate2ndDerivativeAt0Exact(ps: number[][]): number[][]; 10 | export { evaluate2ndDerivativeAt0Exact }; 11 | -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate-2nd-derivative/exact/evaluate-2nd-derivative-at-1-exact.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the *exact* result, `[x,y]`, of evaluating the 2nd derivative of a 3 | * linear, quadratic or cubic bezier curve's power basis at `t === 1`. 4 | * 5 | * @param ps An order 0,1,2 or 3 bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 6 | * 7 | * @doc 8 | */ 9 | declare function evaluate2ndDerivativeAt1Exact(ps: number[][]): number[][]; 10 | export { evaluate2ndDerivativeAt1Exact }; 11 | -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate-2nd-derivative/exact/evaluate-2nd-derivative-exact.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the *exact* result, `[x,y]`, of evaluating the 2nd derivative of a 3 | * linear, quadratic or cubic bezier curve's power basis at `t`. 4 | * 5 | * @param ps a cubic bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 6 | * @param t the t parameter 7 | * 8 | * @doc mdx 9 | */ 10 | declare function evaluate2ndDerivativeExact(ps: number[][], t: number): number[][]; 11 | export { evaluate2ndDerivativeExact }; 12 | -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate-2nd-derivative/exact/evaluate-2nd-derivative-exact.js: -------------------------------------------------------------------------------- 1 | import { toPowerBasis_2ndDerivativeExact } from "../../../to-power-basis/to-power-basis-2nd-derivative/exact/to-power-basis-2nd-derivative-exact.js"; 2 | import { eHorner } from 'flo-poly'; 3 | /** 4 | * Returns the *exact* result, `[x,y]`, of evaluating the 2nd derivative of a 5 | * linear, quadratic or cubic bezier curve's power basis at `t`. 6 | * 7 | * @param ps a cubic bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 8 | * @param t the t parameter 9 | * 10 | * @doc mdx 11 | */ 12 | function evaluate2ndDerivativeExact(ps, t) { 13 | const [ddPsX, ddPsY] = toPowerBasis_2ndDerivativeExact(ps); 14 | return [eHorner(ddPsX, t), eHorner(ddPsY, t)]; 15 | } 16 | export { evaluate2ndDerivativeExact }; 17 | //# sourceMappingURL=evaluate-2nd-derivative-exact.js.map -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate-2nd-derivative/exact/evaluate-2nd-derivative-exact.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"evaluate-2nd-derivative-exact.js","sourceRoot":"","sources":["../../../../src/local-properties-at-t/evaluate-2nd-derivative/exact/evaluate-2nd-derivative-exact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,oGAAoG,CAAC;AACrJ,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC;;;;;;;;GAQG;AACH,SAAS,0BAA0B,CAAC,EAAc,EAAE,CAAS;IAC5D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,+BAA+B,CAAC,EAAE,CAAC,CAAC;IAE3D,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC;AAGD,OAAO,EAAE,0BAA0B,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate/double/eval-de-casteljau.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the resulting point of evaluating the given bezier curve at the 3 | * given parameter `t`. 4 | * 5 | * * uses [De Casteljau's algorithm](https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm) 6 | * in double precision floating point arithmetic 7 | * 8 | * The resulting point `p` is returned as the pair `[x,y]`, where `x` and `y` are 9 | * double precision floating point numbers. 10 | * 11 | * @param ps an order 1,2 or 3 bezier curve, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 12 | * @param t the parameter value where the bezier should be evaluated 13 | * 14 | * @doc mdx 15 | **/ 16 | declare function evalDeCasteljau(ps: number[][], t: number): number[]; 17 | export { evalDeCasteljau }; 18 | -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate/double/evaluate.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the resulting point of evaluating the given bezier curve at the 3 | * given parameter `t`. 4 | * 5 | * * uses power bases conversion and subsequently [Horner's Method](https://en.wikipedia.org/wiki/Horner%27s_method) 6 | * to evaluate the polynomial in double precision floating point arithmetic. 7 | * 8 | * The resulting point `p` is returned as the pair `[x,y]`, where `x` and `y` are 9 | * double precision floating point numbers. 10 | * 11 | * @param ps an order 1, 2 or 3 bezier curve, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 12 | * @param t the parameter value where the bezier should be evaluated 13 | * 14 | * @doc mdx 15 | */ 16 | declare function evaluate(ps: number[][], t: number): number[]; 17 | export { evaluate }; 18 | -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate/double/evaluate.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"evaluate.js","sourceRoot":"","sources":["../../../../src/local-properties-at-t/evaluate/double/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iEAAiE,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC;;;;;;;;;;;;;;GAcG;AACH,SAAS,QAAQ,CACT,EAAc,EACd,CAAS;IAEhB,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC;IAEnB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAAC,CAAC;IAC9B,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAAC,OAAO,EAAE,CAAC,GAAG,GAAC,CAAC,CAAC,CAAC;IAAC,CAAC;IAElC,MAAM,CAAC,CAAC,EAAC,CAAC,CAAC,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC;IAE/B,OAAO;QACH,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;QACZ,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;KACf,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/local-properties-at-t/evaluate/exact/evaluate-exact.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the *exact* resulting point of evaluating the given bezier curve at 3 | * the given `t` parameter. 4 | * 5 | * * the result is returned as `[x,y]`, where `x` and `y` are [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf) floating 6 | * point expansions 7 | * 8 | * @param ps an order 0,1,2 or 3 bezier curve given as an ordered array of its 9 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 10 | * @param t 11 | * 12 | * @doc mdx 13 | */ 14 | declare function evaluateExact(ps: number[][], t: number): number[][]; 15 | export { evaluateExact }; 16 | -------------------------------------------------------------------------------- /node/local-properties-at-t/normal/normal.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a normal vector (not necessarily of unit length) of a bezier curve 3 | * at a specific given parameter value `t` by simply taking the `tangent` at 4 | * that point and rotating it by 90 degrees. 5 | * 6 | * * uses double precision calculations internally 7 | * 8 | * @param ps a linear, quadratic or cubic bezier curve given by its ordered 9 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 10 | * @param t the parameter value where the normal should be evaluated 11 | * 12 | * @doc mdx 13 | */ 14 | declare function normal(ps: number[][], t: number): number[]; 15 | export { normal }; 16 | -------------------------------------------------------------------------------- /node/local-properties-at-t/normal/normal.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"normal.js","sourceRoot":"","sources":["../../../src/local-properties-at-t/normal/normal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4FAA4F,CAAC;AACxI,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC;;;;;;;;;;;;GAYG;AACH,SAAS,MAAM,CAAC,EAAc,EAAE,CAAS;IACxC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAC;IAEhD,OAAO;QACN,CAAC,MAAM,CAAC,EAAE,EAAC,CAAC,CAAC;QACb,MAAM,CAAC,EAAE,EAAC,CAAC,CAAC;KACZ,CAAC;AACH,CAAC;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/local-properties-at-t/normal/normal2.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a normal vector (not necessarily of unit length) of a bezier curve 3 | * at a specific given parameter value `t` by simply taking the `tangent` at 4 | * that point and rotating it by 90 degrees. 5 | * 6 | * * uses double precision calculations internally 7 | * 8 | * @param ps a linear, quadratic or cubic bezier curve given by its ordered 9 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 10 | * @param t the parameter value where the normal should be evaluated 11 | * 12 | * @doc mdx 13 | */ 14 | declare function normal2(ps: number[][], t: number): number[]; 15 | export { normal2 }; 16 | -------------------------------------------------------------------------------- /node/local-properties-at-t/tangent/double/tangent-at-0.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the tangent vector (not necessarily of unit length) of an 3 | * order 0,1,2 or 3 bezier curve at `t === 0`, i.e. 4 | * returns the result, `[x,y]`, of evaluating the derivative of a linear, 5 | * quadratic or cubic bezier curve's power basis at `t === 0`. 6 | * 7 | * * uses double precision calculations internally 8 | * 9 | * @param ps An order 1,2 or 3 bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 10 | * 11 | * @doc 12 | */ 13 | declare function tangentAt0(ps: number[][]): number[]; 14 | export { tangentAt0 }; 15 | -------------------------------------------------------------------------------- /node/local-properties-at-t/tangent/double/tangent-at-1.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the tangent vector (not necessarily of unit length) of an 3 | * order 0,1,2 or 3 bezier curve at `t === 1`, i.e. 4 | * Returns the result, `[x,y]`, of evaluating the derivative of a linear, 5 | * quadratic or cubic bezier curve's power basis at `t === 1`. 6 | * 7 | * * uses double precision calculations internally 8 | * 9 | * @param ps An order 1,2 or 3 bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 10 | * 11 | * @doc 12 | */ 13 | declare function tangentAt1(ps: number[][]): number[]; 14 | export { tangentAt1 }; 15 | -------------------------------------------------------------------------------- /node/local-properties-at-t/tangent/double/tangent.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the tangent vector (not necessarily of unit length) of an 3 | * order 0,1,2 or 3 bezier curve at a specific given parameter value `t`, i.e. 4 | * returns the `[x,y]` value of the once differentiated (with respect to `t`) 5 | * bezier curve's power basis when evaluated at `t`. 6 | * 7 | * * uses double precision calculations internally 8 | * 9 | * @param ps a linear, quadratic or cubic bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 10 | * @param t the t parameter 11 | * 12 | * @doc mdx 13 | */ 14 | declare function tangent(ps: number[][], t: number): number[]; 15 | export { tangent }; 16 | -------------------------------------------------------------------------------- /node/local-properties-at-t/tangent/double/tangent.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"tangent.js","sourceRoot":"","sources":["../../../../src/local-properties-at-t/tangent/double/tangent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,+FAA+F,CAAC;AAG3I;;;;;;;;;;;;GAYG;AACF,SAAS,OAAO,CAAC,EAAc,EAAE,CAAS;IACvC,MAAM,CAAC,EAAE,EAAC,EAAE,CAAC,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAC;IAE/C,OAAO;QACH,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QACb,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;KAChB,CAAC;AACL,CAAC;AAGD,OAAO,EAAE,OAAO,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/local-properties-at-t/tangent/exact/tangent-at-0-exact.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the *exact* tangent vector (not necessarily of unit length) of an 3 | * order 0,1,2 or 3 bezier curve at `t === 0`, i.e. 4 | * returns the result, `[x,y]`, of evaluating the derivative of a linear, 5 | * quadratic or cubic bezier curve's power basis at `t === 0`. 6 | * 7 | * @param ps an order 0,1,2 or 3 bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 8 | * 9 | * @doc 10 | */ 11 | declare function tangentAt0Exact(ps: number[][]): number[][]; 12 | export { tangentAt0Exact }; 13 | -------------------------------------------------------------------------------- /node/local-properties-at-t/tangent/exact/tangent-at-1-exact.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the *exact* tangent vector (not necessarily of unit length) of an 3 | * order 0,1,2 or 3 bezier curve at `t === 1`, i.e. 4 | * returns the exact result (`[x,y]`) of evaluating the derivative of a linear, 5 | * quadratic or cubic bezier curve's power basis at `t === 1`. 6 | * 7 | * @param ps an order 0,1,2 or 3 bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 8 | * 9 | * @doc 10 | */ 11 | declare function tangentAt1Exact(ps: number[][]): number[][]; 12 | export { tangentAt1Exact }; 13 | -------------------------------------------------------------------------------- /node/local-properties-at-t/tangent/exact/tangent-exact.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the *exact* tangent vector (not necessarily of unit length) of an 3 | * order 0,1,2 or 3 bezier curve at a specific parameter `t`, i.e. 4 | * returns the `[x,y]` value of the once differentiated (with respect to `t`) 5 | * bezier curve's power basis when evaluated at `t`. 6 | * 7 | * @param ps a linear, quadratic or cubic bezier, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 8 | * @param t the t parameter 9 | * 10 | * @doc 11 | */ 12 | declare function tangentExact(ps: number[][], t: number): number[][]; 13 | export { tangentExact }; 14 | -------------------------------------------------------------------------------- /node/local-properties-at-t/tangent/exact/tangent-exact.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"tangent-exact.js","sourceRoot":"","sources":["../../../../src/local-properties-at-t/tangent/exact/tangent-exact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,+BAA+B,EAAE,MAAM,oGAAoG,CAAC;AAGrJ;;;;;;;;;;GAUG;AACF,SAAS,YAAY,CACd,EAAc,EAAE,CAAS;IAE5B,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,+BAA+B,CAAC,EAAE,CAAC,CAAC;IAErD,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/local-properties-to-t/get-t-at-length.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the `t` parameter value where the given bezier curve reaches the 3 | * given length `s` starting from `t = 0` and clipping at `t = 1.125`. 4 | * 5 | * @param ps an order 0,1,2 or 3 bezier curve given by an ordered array of its 6 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 7 | * @param s the length 8 | * 9 | * @doc mdx 10 | */ 11 | declare function getTAtLength(ps: number[][], s: number): number; 12 | export { getTAtLength }; 13 | -------------------------------------------------------------------------------- /node/local-properties-to-t/get-t-at-length.js: -------------------------------------------------------------------------------- 1 | import { brent } from "flo-poly"; 2 | import { length } from "../global-properties/length/length.js"; 3 | /** 4 | * Returns the `t` parameter value where the given bezier curve reaches the 5 | * given length `s` starting from `t = 0` and clipping at `t = 1.125`. 6 | * 7 | * @param ps an order 0,1,2 or 3 bezier curve given by an ordered array of its 8 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 9 | * @param s the length 10 | * 11 | * @doc mdx 12 | */ 13 | function getTAtLength(ps, s) { 14 | if (s === 0) { 15 | return 0; 16 | } 17 | const lenAtT = (t) => length([0, t], ps); 18 | return brent(t => (lenAtT(t) - s), 0, 1.125); 19 | } 20 | export { getTAtLength }; 21 | //# sourceMappingURL=get-t-at-length.js.map -------------------------------------------------------------------------------- /node/local-properties-to-t/get-t-at-length.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"get-t-at-length.js","sourceRoot":"","sources":["../../src/local-properties-to-t/get-t-at-length.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAG/D;;;;;;;;;GASG;AACH,SAAS,YAAY,CACnB,EAAc,EACd,CAAS;IAEV,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAAC,OAAO,CAAC,CAAC;IAAC,CAAC;IAE1B,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEhD,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/foot-and-endpoint-info.d.ts: -------------------------------------------------------------------------------- 1 | import { RootInterval } from "flo-poly"; 2 | type FootAndEndpointInfo = { 3 | p: number[]; 4 | t: number; 5 | d: number; 6 | box: number[][]; 7 | ri: RootInterval; 8 | dSquaredI: number[]; 9 | }; 10 | export { FootAndEndpointInfo }; 11 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/foot-and-endpoint-info.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=foot-and-endpoint-info.js.map -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/foot-and-endpoint-info.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"foot-and-endpoint-info.js","sourceRoot":"","sources":["../../../src/simultaneous-properties/closest-and-furthest-point-on-bezier/foot-and-endpoint-info.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/get-coeffs/double-double/get-footpoint-poly-1-dd.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the polynomial whose roots are all the `t` values on the given bezier 3 | * curve such that the line from the given point to the point on the bezier 4 | * evaluated at `t` is tangent to the bezier curve at `t`. 5 | * 6 | * * intermediate calculations are done (and the final result returned in) 7 | * double-double precision 8 | * 9 | * @param ps an order 1 bezier curve given as an ordered array of its 10 | * control point coordinates, e.g. `[[0,0], [1,1]]` 11 | * @param p a point, e.g. `[1,2]` 12 | * 13 | * @internal 14 | */ 15 | declare function getFootpointPoly1Dd(ps: number[][], p: number[]): number[][]; 16 | export { getFootpointPoly1Dd }; 17 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/get-coeffs/double-double/get-footpoint-poly-2-dd.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the polynomial whose roots are all the `t` values on the given bezier 3 | * curve such that the line from the given point to the point on the bezier 4 | * evaluated at `t` is tangent to the bezier curve at `t`. 5 | * 6 | * * intermediate calculations are done (and the final result returned in) 7 | * double-double precision 8 | * 9 | * @param ps an order 2 bezier curve given as an ordered array of its 10 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1]]` 11 | * @param p a point, e.g. `[1,2]` 12 | * 13 | * @internal 14 | */ 15 | declare function getFootpointPoly2Dd(ps: number[][], p: number[]): number[][]; 16 | export { getFootpointPoly2Dd }; 17 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/get-coeffs/double-double/get-footpoint-poly-3-dd.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the polynomial whose roots are all the `t` values on the given bezier 3 | * curve such that the line from the given point to the point on the bezier 4 | * evaluated at `t` is tangent to the bezier curve at `t`. 5 | * 6 | * * intermediate calculations are done (and the final result returned in) 7 | * double-double precision 8 | * 9 | * @param ps an order 3 bezier curve given as an ordered array of its 10 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 11 | * @param p a point, e.g. `[1,2]` 12 | * 13 | * @internal 14 | */ 15 | declare function getFootpointPoly3Dd(ps: number[][], p: number[]): [number[], number[], number[], number[], number[], number[]]; 16 | export { getFootpointPoly3Dd }; 17 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/get-coeffs/double-double/get-footpoint-poly-dd.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the polynomial whose roots are all the `t` parameter values on the 3 | * given bezier curve such that the line from the given point to the point on 4 | * the bezier curve evaluated at `t` is tangent to the bezier curve at `t`. 5 | * 6 | * * intermediate calculations are done (and the final result returned in) 7 | * double-double precision 8 | * 9 | * @param ps an order 1,2 or 3 bezier curve given as an ordered array of its 10 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 11 | * @param p a point, e.g. `[1,2]` 12 | */ 13 | declare function getFootpointPolyDd(ps: number[][], p: number[]): number[][]; 14 | export { getFootpointPolyDd }; 15 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/get-coeffs/double/get-footpoint-poly-1.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function getFootpointPoly1(ps: number[][], p: number[]): number[]; 3 | export { getFootpointPoly1 }; 4 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/get-coeffs/double/get-footpoint-poly-1.js: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | function getFootpointPoly1(ps, p) { 3 | const [[x0, y0], [x1, y1]] = ps; 4 | const [xp, yp] = p; 5 | const xx0 = x0 - xp; 6 | const xx1 = x1 - xp; 7 | const yy0 = y0 - yp; 8 | const yy1 = y1 - yp; 9 | const x01 = xx0 * xx1; 10 | const y01 = yy0 * yy1; 11 | const s1 = x01 + y01; 12 | const s2 = yy0 * yy0 + xx0 * xx0; 13 | const t1 = (xx1 * xx1 + yy1 * yy1) + (s2 - 2 * s1); 14 | const t0 = s1 - s2; 15 | return [t1, t0]; 16 | } 17 | export { getFootpointPoly1 }; 18 | //# sourceMappingURL=get-footpoint-poly-1.js.map -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/get-coeffs/double/get-footpoint-poly-2.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function getFootpointPoly2(ps: number[][], p: number[]): number[]; 3 | export { getFootpointPoly2 }; 4 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/get-coeffs/double/get-footpoint-poly-3.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | declare function getFootpointPoly3(ps: number[][], p: number[]): number[]; 3 | export { getFootpointPoly3 }; 4 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/get-coeffs/double/get-footpoint-poly.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a polynomial in 1 variable whose roots are the parameter values of 3 | * the foot points on the given bezier curve of the given point. 4 | * 5 | * The returned polynomial coefficients are given densely as an array of 6 | * double precision floating point numbers from highest to lowest power, 7 | * e.g. `[[0,5],[0,-3],[0,0]]` represents the polynomial `5x^2 - 3x`. 8 | * 9 | * * intermediate calculations are done in double precision 10 | * 11 | * @param ps an order 1,2 or 3 bezier curve given as an ordered array of its 12 | * control points, e.g. `[[1,2],[3,4],[5,7],[0,0]]` 13 | * @param p 14 | */ 15 | declare function getFootpointPoly(ps: number[][], p: number[]): number[]; 16 | export { getFootpointPoly }; 17 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-and-furthest-point-on-bezier/root-interval-to-distance-squared-interval.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the distance interval squared given the root interval (currently 3 | * ignoring multiplicity) 4 | * 5 | * @param box 6 | * @param p 7 | * 8 | * @internal 9 | */ 10 | declare function rootIntervalToDistanceSquaredInterval(box: number[][], p: number[]): number[]; 11 | export { rootIntervalToDistanceSquaredInterval }; 12 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/distance-compare.d.ts: -------------------------------------------------------------------------------- 1 | import { DistanceInterval } from "./distance-interval.js"; 2 | /** 3 | * @param a 4 | * @param b 5 | * 6 | * @internal 7 | */ 8 | declare function distanceCompareMaxAsc(a: DistanceInterval, b: DistanceInterval): number; 9 | /** @internal */ 10 | declare function distanceCompareMinDesc(a: DistanceInterval, b: DistanceInterval): number; 11 | export { distanceCompareMinDesc, distanceCompareMaxAsc }; 12 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/distance-compare.js: -------------------------------------------------------------------------------- 1 | import { getMaxDistance, getMinDistance } from "./get-min-max-distance.js"; 2 | /** 3 | * @param a 4 | * @param b 5 | * 6 | * @internal 7 | */ 8 | function distanceCompareMaxAsc(a, b) { 9 | const diff = (getMaxDistance(a) - getMaxDistance(b)); 10 | if (diff !== 0) { 11 | return diff; 12 | } 13 | return a.tS - b.tS; 14 | } 15 | /** @internal */ 16 | function distanceCompareMinDesc(a, b) { 17 | const diff = (getMinDistance(b) - getMinDistance(a)); 18 | if (diff !== 0) { 19 | return diff; 20 | } 21 | return a.tS - b.tS; 22 | } 23 | export { distanceCompareMinDesc, distanceCompareMaxAsc }; 24 | //# sourceMappingURL=distance-compare.js.map -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/distance-compare.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"distance-compare.js","sourceRoot":"","sources":["../../../src/simultaneous-properties/closest-distance-between-beziers/distance-compare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3E;;;;;GAKG;AACH,SAAS,qBAAqB,CACtB,CAAmB,EACnB,CAAmB;IAEvB,MAAM,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;AACvB,CAAC;AAGD,gBAAgB;AAChB,SAAS,sBAAsB,CACvB,CAAmB,EACnB,CAAmB;IAEvB,MAAM,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;AACvB,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/distance-interval.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | interface DistanceInterval { 3 | tS: number; 4 | tE: number; 5 | pL: number[]; 6 | pR: number[]; 7 | dL: number; 8 | dR: number; 9 | eL: number; 10 | eR: number; 11 | } 12 | export { DistanceInterval }; 13 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/distance-interval.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=distance-interval.js.map -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/distance-interval.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"distance-interval.js","sourceRoot":"","sources":["../../../src/simultaneous-properties/closest-distance-between-beziers/distance-interval.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/get-min-max-distance.d.ts: -------------------------------------------------------------------------------- 1 | import { DistanceInterval } from "./distance-interval"; 2 | /** @internal */ 3 | declare function getMaxDistance(i: DistanceInterval): number; 4 | /** @internal */ 5 | declare function getMinDistance(i: DistanceInterval): number; 6 | export { getMaxDistance, getMinDistance }; 7 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/get-min-max-distance.js: -------------------------------------------------------------------------------- 1 | const { min, max } = Math; 2 | /** @internal */ 3 | function getMaxDistance(i) { 4 | return max(i.dL + i.eL, i.dR + i.eR); 5 | } 6 | /** @internal */ 7 | function getMinDistance(i) { 8 | return min(i.dL - i.eL, i.dR - i.eR); 9 | } 10 | export { getMaxDistance, getMinDistance }; 11 | //# sourceMappingURL=get-min-max-distance.js.map -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/get-min-max-distance.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"get-min-max-distance.js","sourceRoot":"","sources":["../../../src/simultaneous-properties/closest-distance-between-beziers/get-min-max-distance.ts"],"names":[],"mappings":"AAEA,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAG1B,gBAAgB;AAChB,SAAS,cAAc,CAAC,CAAmB;IACvC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AACzC,CAAC;AAGD,gBAAgB;AAChB,SAAS,cAAc,CAAC,CAAmB;IACvC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AACzC,CAAC;AAGD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/points-with-distance.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | interface PointsWithDistance { 3 | pA: { 4 | p: number[]; 5 | t: number; 6 | }; 7 | pB: { 8 | p: number[]; 9 | t: number; 10 | }; 11 | d: number; 12 | } 13 | export { PointsWithDistance }; 14 | -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/points-with-distance.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=points-with-distance.js.map -------------------------------------------------------------------------------- /node/simultaneous-properties/closest-distance-between-beziers/points-with-distance.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"points-with-distance.js","sourceRoot":"","sources":["../../../src/simultaneous-properties/closest-distance-between-beziers/points-with-distance.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node/simultaneous-properties/equal.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the two given bezier curves are exactly equal when compared 3 | * by value (deep equality), `false` otherwise 4 | * 5 | * @param ps1 an order 0,1,2 or 3 bezier curve given as an ordered array of its 6 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 7 | * @param ps2 another bezier curve 8 | * 9 | * @doc 10 | */ 11 | declare function equal(ps1: number[][], ps2: number[][]): boolean; 12 | export { equal }; 13 | -------------------------------------------------------------------------------- /node/simultaneous-properties/equal.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the two given bezier curves are exactly equal when compared 3 | * by value (deep equality), `false` otherwise 4 | * 5 | * @param ps1 an order 0,1,2 or 3 bezier curve given as an ordered array of its 6 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 7 | * @param ps2 another bezier curve 8 | * 9 | * @doc 10 | */ 11 | function equal(ps1, ps2) { 12 | if (ps1 === ps2) { 13 | return true; 14 | } 15 | if (ps1.length !== ps2.length) { 16 | return false; 17 | } 18 | for (let i = 0; i < ps1.length; i++) { 19 | if (ps1[i][0] !== ps2[i][0] || ps1[i][1] !== ps2[i][1]) { 20 | return false; 21 | } 22 | } 23 | return true; 24 | } 25 | export { equal }; 26 | //# sourceMappingURL=equal.js.map -------------------------------------------------------------------------------- /node/simultaneous-properties/equal.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"equal.js","sourceRoot":"","sources":["../../src/simultaneous-properties/equal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,SAAS,KAAK,CACN,GAAe,EACf,GAAe;IAEnB,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;IAEjC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC;QAAC,OAAO,KAAK,CAAC;IAAC,CAAC;IAEhD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9B,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACrD,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/simultaneous-properties/get-interface-rotation.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the rotation angle (-𝜋 <= θ <= 𝜋 *guaranteed*) from some vector to 3 | * another vector considering them to both start at the same point. 4 | * 5 | * If one of the vectors is the zero vector then `0` is returned. 6 | * 7 | * It can also be imagined that the 2nd vector starts where the 1st one ends. 8 | * 9 | * Intermediate calculations are done in double precision in a numerically 10 | * stable manner. 11 | * 12 | * @param a the first 2d vector given as `[x,y]` where `x` and `y` are the 13 | * coordinates, e.g. `[2,3]` 14 | * @param b the second 2d vector 15 | */ 16 | declare function getInterfaceRotation(a: number[], b: number[]): number; 17 | export { getInterfaceRotation }; 18 | -------------------------------------------------------------------------------- /node/simultaneous-properties/hausdorff-distance/get-max-hausdorff.d.ts: -------------------------------------------------------------------------------- 1 | import { HausdorffInterval } from "./hausdorff-interval"; 2 | /** @internal */ 3 | declare function getMaxHausdorff(i: HausdorffInterval): number; 4 | export { getMaxHausdorff }; 5 | -------------------------------------------------------------------------------- /node/simultaneous-properties/hausdorff-distance/get-max-hausdorff.js: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | function getMaxHausdorff(i) { 3 | return Math.max(i.hL + i.hEL, i.hR + i.hER); 4 | } 5 | export { getMaxHausdorff }; 6 | //# sourceMappingURL=get-max-hausdorff.js.map -------------------------------------------------------------------------------- /node/simultaneous-properties/hausdorff-distance/get-max-hausdorff.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"get-max-hausdorff.js","sourceRoot":"","sources":["../../../src/simultaneous-properties/hausdorff-distance/get-max-hausdorff.ts"],"names":[],"mappings":"AAGA,gBAAgB;AAChB,SAAS,eAAe,CAAC,CAAoB;IACzC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAChD,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/simultaneous-properties/hausdorff-distance/hausdorff-compare.d.ts: -------------------------------------------------------------------------------- 1 | import { HausdorffInterval } from "./hausdorff-interval.js"; 2 | /** 3 | * @param a 4 | * @param b 5 | * 6 | * @internal 7 | */ 8 | declare function hausdorffCompare(a: HausdorffInterval, b: HausdorffInterval): number; 9 | export { hausdorffCompare }; 10 | -------------------------------------------------------------------------------- /node/simultaneous-properties/hausdorff-distance/hausdorff-compare.js: -------------------------------------------------------------------------------- 1 | import { getMaxHausdorff } from "./get-max-hausdorff.js"; 2 | /** 3 | * @param a 4 | * @param b 5 | * 6 | * @internal 7 | */ 8 | function hausdorffCompare(a, b) { 9 | const diff = (getMaxHausdorff(a) - getMaxHausdorff(b)); 10 | if (diff !== 0) { 11 | return diff; 12 | } 13 | //diff = a.tS - b.tS; 14 | //if (diff !== 0) { return diff; } 15 | //return a.tE - b.tE; 16 | return a.tS - b.tS; 17 | } 18 | export { hausdorffCompare }; 19 | //# sourceMappingURL=hausdorff-compare.js.map -------------------------------------------------------------------------------- /node/simultaneous-properties/hausdorff-distance/hausdorff-compare.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"hausdorff-compare.js","sourceRoot":"","sources":["../../../src/simultaneous-properties/hausdorff-distance/hausdorff-compare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAIzD;;;;;GAKG;AACH,SAAS,gBAAgB,CACjB,CAAoB,EACpB,CAAoB;IAExB,MAAM,IAAI,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;IAChC,qBAAqB;IACrB,kCAAkC;IAClC,qBAAqB;IACrB,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;AACvB,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/simultaneous-properties/hausdorff-distance/hausdorff-distance.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"hausdorff-distance.js","sourceRoot":"","sources":["../../../src/simultaneous-properties/hausdorff-distance/hausdorff-distance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,gBAAgB;AAChB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;AAGrB;;;;;;;;;;;;;;;;;;;;GAoBG;AACF,SAAS,iBAAiB,CACnB,CAAa,EACb,CAAa,EACb,SAAkB,EAClB,aAAsB;IAE1B,MAAM,EAAE,GAAG,yBAAyB,CAAC,CAAC,EAAC,CAAC,EAAC,SAAS,EAAC,aAAa,CAAC,CAAC;IAClE,MAAM,EAAE,GAAG,yBAAyB,CAAC,CAAC,EAAC,CAAC,EAAC,SAAS,EAAC,aAAa,CAAC,CAAC;IAElE,OAAO,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AACvB,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/simultaneous-properties/hausdorff-distance/hausdorff-interval.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | interface HausdorffInterval { 3 | tS: number; 4 | tE: number; 5 | hL: number; 6 | hR: number; 7 | hEL: number; 8 | hER: number; 9 | } 10 | export { HausdorffInterval }; 11 | -------------------------------------------------------------------------------- /node/simultaneous-properties/hausdorff-distance/hausdorff-interval.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=hausdorff-interval.js.map -------------------------------------------------------------------------------- /node/simultaneous-properties/hausdorff-distance/hausdorff-interval.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"hausdorff-interval.js","sourceRoot":"","sources":["../../../src/simultaneous-properties/hausdorff-distance/hausdorff-interval.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node/simultaneous-properties/heap.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * see [Wikipedia](https://en.wikipedia.org/wiki/Heap_(data_structure)) 3 | * 4 | * @internal 5 | */ 6 | declare class Heap { 7 | private compare; 8 | heap: T[]; 9 | constructor(compare: (a: T, b: T) => number); 10 | insert(t: T): void; 11 | popMax(): T; 12 | private swimDown; 13 | swapMinOrMax(t: T): void; 14 | static getParentIdx(i: number): number; 15 | static getLeftChild(i: number): number; 16 | static getRightChild(i: number): number; 17 | } 18 | export { Heap }; 19 | -------------------------------------------------------------------------------- /node/simultaneous-properties/is-point-on-bezier-extension/is-point-on-bezier-extension-2.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the given point is on the given quadratic bezier curve where 3 | * the parameter `t` is allowed to extend to ±infinity, i.e. `t` is an element of 4 | * `[-∞, +∞]`, `false` otherwise. 5 | * 6 | * @param ps a quadratic bezier curve 7 | * @param p a point with coordinates given as [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf) 8 | * expansions; if only double precision coordinates need to be provided then 9 | * wrap them in a one element array, e.g. for a point with `x` and `y` coordinates 10 | * of `1` and `2` set `p === [[1],[2]]`. 11 | * 12 | * @internal 13 | */ 14 | declare function isPointOnBezierExtension2(ps: number[][], p: number[][]): boolean; 15 | export { isPointOnBezierExtension2 }; 16 | -------------------------------------------------------------------------------- /node/simultaneous-properties/is-point-on-bezier-extension/is-point-on-bezier-extension-3.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the given point is on the given cubic bezier curve where 3 | * the parameter, `t`, is allowed to extend to `±∞`, i.e. if `t ∈ (-∞, +∞)`, 4 | * `false` otherwise. 5 | * 6 | * @param ps a cubic bezier curve 7 | * @param p a point with coordinates given as [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf) 8 | * expansions; if only double precision coordinates need to be provided then 9 | * wrap them in a one element array, e.g. for a point with `x` and `y` coordinates 10 | * of `1` and `2` set `p === [[1],[2]]`. 11 | * 12 | * @internal 13 | */ 14 | declare function isPointOnBezierExtension3(ps: number[][], p: number[][]): boolean; 15 | export { isPointOnBezierExtension3 }; 16 | -------------------------------------------------------------------------------- /node/sub-1-ulp.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Subtract one unit in the last place (ulp) from the given number 3 | * 4 | * * subnormal numbers (and 0) are returned unaltered 5 | * @internal 6 | */ 7 | declare function sub1Ulp(n: number): number; 8 | export { sub1Ulp }; 9 | -------------------------------------------------------------------------------- /node/sub-1-ulp.js: -------------------------------------------------------------------------------- 1 | const { EPSILON: eps } = Number; 2 | const u = eps / 2; 3 | const es = (eps ** 2) / 2; 4 | const ups = u + es; 5 | /** 6 | * Subtract one unit in the last place (ulp) from the given number 7 | * 8 | * * subnormal numbers (and 0) are returned unaltered 9 | * @internal 10 | */ 11 | function sub1Ulp(n) { 12 | return n > 0 ? n - n * ups : n + n * ups; 13 | } 14 | export { sub1Ulp }; 15 | //# sourceMappingURL=sub-1-ulp.js.map -------------------------------------------------------------------------------- /node/sub-1-ulp.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"sub-1-ulp.js","sourceRoot":"","sources":["../src/sub-1-ulp.ts"],"names":[],"mappings":"AAAA,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;AAEhC,MAAM,CAAC,GAAG,GAAG,GAAC,CAAC,CAAC;AAChB,MAAM,EAAE,GAAG,CAAC,GAAG,IAAE,CAAC,CAAC,GAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;AAGnB;;;;;GAKG;AACH,SAAS,OAAO,CAAC,CAAS;IACtB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAC,GAAG,CAAC;AACzC,CAAC;AAGD,OAAO,EAAE,OAAO,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/to-power-basis/to-power-basis-1st-derivative/double-double/to-power-basis-1st-derivative-dd.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the derivative of the power basis representation of a bezier 3 | * curve of order cubic or less (with intermediate calculations done in 4 | * double-double precision). 5 | * 6 | * * returns the resulting power basis x and y coordinate polynomials from 7 | * highest power to lowest, e.g. if `x(t) = at^2 + bt + c` 8 | * and `y(t) = dt^2 + et + f` then the result is returned 9 | * as `[[a,b,c],[d,e,f]]`, where the `a,b,c,...` are in double-double precision 10 | * 11 | * @param ps an order 0,1,2 or 3 bezier curve given by an ordered array of its 12 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 13 | * 14 | * @doc 15 | */ 16 | declare function toPowerBasis_1stDerivativeDd(ps: number[][]): number[][][]; 17 | export { toPowerBasis_1stDerivativeDd }; 18 | -------------------------------------------------------------------------------- /node/to-power-basis/to-power-basis-1st-derivative/double/to-power-basis-1st-derivative.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the derivative of the power basis representation of a 3 | * bezier curve of order cubic or less (with intermediate calculations done in 4 | * double precision). 5 | * 6 | * * returns the resulting power basis x and y coordinate polynomials from 7 | * highest power to lowest, e.g. if `x(t) = at^2 + bt + c` 8 | * and `y(t) = dt^2 + et + f` then the result is returned 9 | * as `[[a,b,c],[d,e,f]]` 10 | * 11 | * @param ps an order 0,1,2 or 3 bezier curve given by an ordered array of its 12 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 13 | * 14 | * @doc 15 | */ 16 | declare function toPowerBasis_1stDerivative(ps: number[][]): number[][]; 17 | export { toPowerBasis_1stDerivative }; 18 | -------------------------------------------------------------------------------- /node/to-power-basis/to-power-basis-2nd-derivative/double/to-power-basis-2nd-derivative.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the 2nd derivative of the power basis representation of a 3 | * bezier curve of order cubic or less (with intermediate calculations done in 4 | * double precision). 5 | * 6 | * * returns the resulting power basis x and y coordinate polynomials from 7 | * highest power to lowest, e.g. if `x(t) = at^2 + bt + c` 8 | * and `y(t) = dt^2 + et + f` then the result is returned 9 | * as `[[a,b,c],[d,e,f]]` 10 | * 11 | * @param ps an order 0,1,2 or 3 bezier curve given by an ordered array of its 12 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 13 | * 14 | * @doc 15 | */ 16 | declare function toPowerBasis_2ndDerivative(ps: number[][]): number[][]; 17 | export { toPowerBasis_2ndDerivative }; 18 | -------------------------------------------------------------------------------- /node/to-power-basis/to-power-basis-3rd-derivative/double/to-power-basis-3rd-derivative.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the 3rd derivative of the power basis representation of a bezier 3 | * curve of order cubic or less (with intermediate calculations done in 4 | * double precision). 5 | * 6 | * * returns the resulting power basis x and y coordinate polynomials from 7 | * highest power to lowest, e.g. if `x(t) = at^2 + bt + c` 8 | * and `y(t) = dt^2 + et + f` then the result is returned 9 | * as `[[a,b,c],[d,e,f]]` 10 | * 11 | * @param ps an order 0,1,2 or 3 bezier curve given by an ordered array of its 12 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 13 | * 14 | * @doc 15 | */ 16 | declare function toPowerBasis_3rdDerivative(ps: number[][]): number[][]; 17 | export { toPowerBasis_3rdDerivative }; 18 | -------------------------------------------------------------------------------- /node/transformation/clone.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a clone of the given cubic bezier (with a different reference). 3 | * 4 | * @param ps a bezier curve given as an ordered array of its 5 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 6 | * 7 | * @doc 8 | */ 9 | declare function clone(ps: number[][]): number[][]; 10 | export { clone }; 11 | -------------------------------------------------------------------------------- /node/transformation/clone.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a clone of the given cubic bezier (with a different reference). 3 | * 4 | * @param ps a bezier curve given as an ordered array of its 5 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 6 | * 7 | * @doc 8 | */ 9 | function clone(ps) { 10 | const ps_ = []; 11 | for (let i = 0; i < ps.length; i++) { 12 | const p = ps[i]; 13 | ps_.push([p[0], p[1]]); 14 | } 15 | return ps_; 16 | } 17 | export { clone }; 18 | //# sourceMappingURL=clone.js.map -------------------------------------------------------------------------------- /node/transformation/clone.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"clone.js","sourceRoot":"","sources":["../../src/transformation/clone.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,SAAS,KAAK,CAAC,EAAc;IAC5B,MAAM,GAAG,GAAe,EAAE,CAAC;IAC3B,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/transformation/degree-or-type/cubic-to-hybrid-quadratic.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"cubic-to-hybrid-quadratic.js","sourceRoot":"","sources":["../../../src/transformation/degree-or-type/cubic-to-hybrid-quadratic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,sBAAsB,CAAC,EAAc;IAQ1C,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClB,MAAM,CAAC,CAAC,EAAE,EAAC,EAAE,CAAC,EAAC,CAAC,EAAE,EAAC,EAAE,CAAC,EAAC,CAAC,EAAE,EAAC,EAAE,CAAC,EAAC,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;QAC7C,OAAO;YACH,CAAC,EAAE,EAAC,EAAE,CAAC;YACP;gBACI,CAAC,CAAC,CAAC,GAAC,EAAE,GAAG,EAAE,CAAC,GAAC,CAAC,EAAE,CAAC,CAAC,GAAC,EAAE,GAAG,EAAE,CAAC,GAAC,CAAC,CAAC;gBAC9B,CAAC,CAAC,CAAC,GAAC,EAAE,GAAG,EAAE,CAAC,GAAC,CAAC,EAAE,CAAC,CAAC,GAAC,EAAE,GAAG,EAAE,CAAC,GAAC,CAAC,CAAC;aACjC;YACD,CAAC,EAAE,EAAC,EAAE,CAAC;SACV,CAAC;IACN,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;AAC7D,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/transformation/degree-or-type/line-to-cubic.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a cubic bezier from the given line with evenly spaced control points. 3 | * 4 | * @param ps a 2d line represented by two points 5 | * 6 | * @doc mdx 7 | */ 8 | declare function lineToCubic(ps: number[][]): number[][]; 9 | export { lineToCubic }; 10 | -------------------------------------------------------------------------------- /node/transformation/degree-or-type/line-to-cubic.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a cubic bezier from the given line with evenly spaced control points. 3 | * 4 | * @param ps a 2d line represented by two points 5 | * 6 | * @doc mdx 7 | */ 8 | function lineToCubic(ps) { 9 | const [[x0, y0], [x1, y1]] = ps; 10 | const xInterval = (x1 - x0) / 3; 11 | const yInterval = (y1 - y0) / 3; 12 | return [ 13 | [x0, y0], 14 | [x0 + xInterval, y0 + yInterval], 15 | [x0 + xInterval * 2, y0 + yInterval * 2], 16 | [x1, y1] 17 | ]; 18 | } 19 | export { lineToCubic }; 20 | //# sourceMappingURL=line-to-cubic.js.map -------------------------------------------------------------------------------- /node/transformation/degree-or-type/line-to-cubic.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"line-to-cubic.js","sourceRoot":"","sources":["../../../src/transformation/degree-or-type/line-to-cubic.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AACH,SAAS,WAAW,CAAC,EAAc;IAClC,MAAM,CAAC,CAAC,EAAE,EAAC,EAAE,CAAC,EAAC,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;IAE7B,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAC,CAAC,CAAC;IAC3B,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAC,CAAC,CAAC;IAEjC,OAAO;QACN,CAAC,EAAE,EAAC,EAAE,CAAC;QACP,CAAC,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,SAAS,CAAC;QAChC,CAAC,EAAE,GAAG,SAAS,GAAC,CAAC,EAAE,EAAE,GAAG,SAAS,GAAC,CAAC,CAAC;QACpC,CAAC,EAAE,EAAC,EAAE,CAAC;KACP,CAAC;AACH,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/transformation/degree-or-type/line-to-quadratic.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a quadratic bezier from the given line with evenly spaced control points. 3 | * 4 | * @param ps a 2d line represented by two points, e.g. `[[1,2],[3,4]]` 5 | * 6 | * @doc mdx 7 | */ 8 | declare function lineToQuadratic(ps: number[][]): number[][]; 9 | export { lineToQuadratic }; 10 | -------------------------------------------------------------------------------- /node/transformation/degree-or-type/line-to-quadratic.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a quadratic bezier from the given line with evenly spaced control points. 3 | * 4 | * @param ps a 2d line represented by two points, e.g. `[[1,2],[3,4]]` 5 | * 6 | * @doc mdx 7 | */ 8 | function lineToQuadratic(ps) { 9 | const [[x0, y0], [x1, y1]] = ps; 10 | return [ 11 | [x0, y0], 12 | [(x0 + x1) / 2, (y0 + y1) / 2], 13 | [x1, y1] 14 | ]; 15 | } 16 | export { lineToQuadratic }; 17 | //# sourceMappingURL=line-to-quadratic.js.map -------------------------------------------------------------------------------- /node/transformation/degree-or-type/line-to-quadratic.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"line-to-quadratic.js","sourceRoot":"","sources":["../../../src/transformation/degree-or-type/line-to-quadratic.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,EAAc;IACtC,MAAM,CAAC,CAAC,EAAE,EAAC,EAAE,CAAC,EAAC,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;IAE7B,OAAO;QACN,CAAC,EAAE,EAAC,EAAE,CAAC;QACP,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,GAAC,CAAC,CAAC;QAC1B,CAAC,EAAE,EAAC,EAAE,CAAC;KACP,CAAC;AACH,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/transformation/degree-or-type/quadratic-to-cubic.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the cubic version of the given quadratic bezier curve (by degree 3 | * elevation). 4 | * 5 | * * quadratic bezier curves can always be represented exactly by cubics - the 6 | * converse is false 7 | * 8 | * @param ps a quadratic bezier curve given as an ordered array of its 9 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1]]` 10 | * 11 | * @doc mdx 12 | */ 13 | declare function quadraticToCubic(ps: number[][]): number[][]; 14 | export { quadraticToCubic }; 15 | -------------------------------------------------------------------------------- /node/transformation/degree-or-type/quadratic-to-cubic.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the cubic version of the given quadratic bezier curve (by degree 3 | * elevation). 4 | * 5 | * * quadratic bezier curves can always be represented exactly by cubics - the 6 | * converse is false 7 | * 8 | * @param ps a quadratic bezier curve given as an ordered array of its 9 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1]]` 10 | * 11 | * @doc mdx 12 | */ 13 | function quadraticToCubic(ps) { 14 | const [[x0, y0], [x1, y1], [x2, y2]] = ps; 15 | return [ 16 | [x0, y0], 17 | [(1 / 3) * x0 + (2 / 3) * x1, (1 / 3) * y0 + (2 / 3) * y1], 18 | [(2 / 3) * x1 + (1 / 3) * x2, (2 / 3) * y1 + (1 / 3) * y2], 19 | [x2, y2] 20 | ]; 21 | } 22 | export { quadraticToCubic }; 23 | //# sourceMappingURL=quadratic-to-cubic.js.map -------------------------------------------------------------------------------- /node/transformation/degree-or-type/quadratic-to-cubic.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"quadratic-to-cubic.js","sourceRoot":"","sources":["../../../src/transformation/degree-or-type/quadratic-to-cubic.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AACH,SAAS,gBAAgB,CAAC,EAAc;IACvC,MAAM,CAAC,CAAC,EAAE,EAAC,EAAE,CAAC,EAAC,CAAC,EAAE,EAAC,EAAE,CAAC,EAAC,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;IAErC,OAAO;QACN,CAAC,EAAE,EAAC,EAAE,CAAC;QACP,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,EAAE,GAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,EAAE,EAAE,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,EAAE,GAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,EAAE,CAAC;QACtC,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,EAAE,GAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,EAAE,EAAE,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,EAAE,GAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,EAAE,CAAC;QACtC,CAAC,EAAE,EAAC,EAAE,CAAC;KACP,CAAC;AACH,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/transformation/degree-or-type/to-cubic.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a cubic bezier curve that is equivalent to the given linear or 3 | * quadratic bezier curve. 4 | * 5 | * Cubics are just returned unaltered. 6 | * 7 | * This function simply uses `lineToCubic` or `quadraticToCubic` internally. 8 | * 9 | * @param ps an order 0,1,2 or 3 bezier curve given as an ordered array of its 10 | * control point coordinates, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 11 | * 12 | * @doc mdx 13 | */ 14 | declare function toCubic(ps: number[][]): number[][]; 15 | export { toCubic }; 16 | -------------------------------------------------------------------------------- /node/transformation/degree-or-type/to-cubic.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"to-cubic.js","sourceRoot":"","sources":["../../../src/transformation/degree-or-type/to-cubic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D;;;;;;;;;;;;GAYG;AACH,SAAS,OAAO,CAAC,EAAc;IAC9B,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ;QAC9B,OAAO,EAAE,CAAC;IACX,CAAC;IAED,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC,CAAC,YAAY;QAClC,OAAO,gBAAgB,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC,CAAC,SAAS;QAC/B,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC;IAED,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ;QAC9B,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QAChB,OAAO,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;AAClE,CAAC;AAGD,OAAO,EAAE,OAAO,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/transformation/get-hodograph.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the hodograph of the given bezier curve. 3 | * 4 | * @param ps an order 1,2 or 3 bezier curve given as an ordered array of its 5 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 6 | * 7 | * @doc mdx 8 | */ 9 | declare function getHodograph(ps: number[][]): number[][]; 10 | export { getHodograph }; 11 | -------------------------------------------------------------------------------- /node/transformation/reduce-order-if-possible.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a reduced order version of the given bezier curve *if* it can be 3 | * represented as such without loss. 4 | * 5 | * Crucially, the reduced order bezier will have exactly the same `t` values 6 | * at specific `x` and `y` coordinates as the original. 7 | * 8 | * @param ps an order 0,1,2 or 3 bezier curve given as an ordered array of its 9 | * control point coordinates, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 10 | * 11 | * @doc mdx 12 | */ 13 | declare function reduceOrderIfPossible(ps: number[][]): number[][]; 14 | export { reduceOrderIfPossible }; 15 | -------------------------------------------------------------------------------- /node/transformation/reverse.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the given points (e.g. bezier curve) in reverse order. 3 | * 4 | * Implementation details: 5 | * ``` 6 | * const reverse = ps => ps.slice().reverse() 7 | * ``` 8 | * 9 | * @param ps a bezier curve given as an ordered array of its 10 | * control point coordinates, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 11 | * 12 | * @doc 13 | */ 14 | declare function reverse(ps: number[][]): number[][]; 15 | export { reverse }; 16 | -------------------------------------------------------------------------------- /node/transformation/reverse.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns the given points (e.g. bezier curve) in reverse order. 3 | * 4 | * Implementation details: 5 | * ``` 6 | * const reverse = ps => ps.slice().reverse() 7 | * ``` 8 | * 9 | * @param ps a bezier curve given as an ordered array of its 10 | * control point coordinates, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 11 | * 12 | * @doc 13 | */ 14 | function reverse(ps) { 15 | return ps.slice().reverse(); 16 | } 17 | export { reverse }; 18 | //# sourceMappingURL=reverse.js.map -------------------------------------------------------------------------------- /node/transformation/reverse.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"reverse.js","sourceRoot":"","sources":["../../src/transformation/reverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,SAAS,OAAO,CAAC,EAAc;IAC9B,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC;AAC7B,CAAC;AAGD,OAAO,EAAE,OAAO,EAAE,CAAA"} -------------------------------------------------------------------------------- /node/transformation/split/from-to.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a bezier curve that starts and ends at the given `t` parameters. 3 | * 4 | * @param ps an order 0,1,2 or 3 bezier curve given as an ordered array of its 5 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 6 | * @param tS the `t` parameter where the resultant bezier should start 7 | * @param tE the `t` parameter where the resultant bezier should end 8 | * 9 | * @doc mdx 10 | */ 11 | declare function fromTo(ps: number[][], tS: number, tE: number): number[][]; 12 | export { fromTo }; 13 | -------------------------------------------------------------------------------- /node/transformation/split/from-to/from-to-1-incl-error-bound.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a bezier curve that starts and ends at the given `t` parameters 3 | * including an error bound (that needs to be multiplied by `3u` before use, 4 | * where `u === Number.EPSILON/2`). 5 | * 6 | * @param ps a linear bezier curve (a line) given as an ordered array of its 7 | * control point coordinates, e.g. `[[0,0], [1,1]]` 8 | * @param tS the `t` parameter where the resultant bezier should start 9 | * @param tE the `t` parameter where the resultant bezier should end 10 | * 11 | * @internal 12 | */ 13 | declare function fromTo1InclErrorBound(ps: number[][], tS: number, tE: number): { 14 | ps: number[][]; 15 | _ps: number[][]; 16 | }; 17 | export { fromTo1InclErrorBound }; 18 | -------------------------------------------------------------------------------- /node/transformation/split/from-to/from-to-1.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a bezier curve that starts and ends at the given `t` parameters. 3 | * 4 | * @param ps a lineer bezier curve (a line) given as an ordered array of its 5 | * control point coordinates, e.g. `[[0,0], [1,1]]` 6 | * @param tS the `t` parameter where the resultant bezier should start 7 | * @param tE the `t` parameter where the resultant bezier should end 8 | * 9 | * @internal 10 | */ 11 | declare function fromTo1(ps: number[][], tS: number, tE: number): number[][]; 12 | export { fromTo1 }; 13 | -------------------------------------------------------------------------------- /node/transformation/split/from-to/from-to-2-incl-error-bound.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a bezier curve that starts and ends at the given `t` parameters 3 | * including an error bound (that needs to be multiplied by `5u`, where 4 | * `u === Number.EPSILON/2`). 5 | * 6 | * @param ps a quadratic bezier curve given as an ordered array of its 7 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1]]` 8 | * @param tS the `t` parameter where the resultant bezier should start 9 | * @param tE the `t` parameter where the resultant bezier should end 10 | * 11 | * @internal 12 | */ 13 | declare function fromTo2InclErrorBound(ps: number[][], tS: number, tE: number): { 14 | ps: number[][]; 15 | _ps: number[][]; 16 | }; 17 | export { fromTo2InclErrorBound }; 18 | -------------------------------------------------------------------------------- /node/transformation/split/from-to/from-to-2.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a bezier curve that starts and ends at the given `t` parameters. 3 | * 4 | * @param ps a quadratic bezier curve given as an ordered array of its 5 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1]]` 6 | * @param tS the `t` parameter where the resultant bezier should start 7 | * @param tE the `t` parameter where the resultant bezier should end 8 | * 9 | * @internal 10 | */ 11 | declare function fromTo2(ps: number[][], tS: number, tE: number): number[][]; 12 | export { fromTo2 }; 13 | -------------------------------------------------------------------------------- /node/transformation/split/from-to/from-to-3-incl-error-bound.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a bezier curve that starts and ends at the given t parameters 3 | * including an error bound (that needs to be multiplied by `9u`, where 4 | * `u === Number.EPSILON/2`). 5 | * 6 | * @param ps a cubic bezier curve given as an ordered array of its 7 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 8 | * @param tS the `t` parameter where the resultant bezier should start 9 | * @param tE the `t` parameter where the resultant bezier should end 10 | * 11 | * @internal 12 | */ 13 | declare function fromTo3InclErrorBound(ps: number[][], tS: number, tE: number): { 14 | ps: number[][]; 15 | _ps: number[][]; 16 | }; 17 | export { fromTo3InclErrorBound }; 18 | -------------------------------------------------------------------------------- /node/transformation/split/from-to/from-to-3.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a bezier curve that starts and ends at the given t parameters. 3 | * 4 | * @param ps a cubic bezier curve given as an ordered array of its 5 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 6 | * @param tS the `t` parameter where the resultant bezier should start 7 | * @param tE the `t` parameter where the resultant bezier should end 8 | * 9 | * @internal 10 | */ 11 | declare function fromTo3(ps: number[][], tS: number, tE: number): number[][]; 12 | export { fromTo3 }; 13 | -------------------------------------------------------------------------------- /node/transformation/split/linked-list/linked-list-node.d.ts: -------------------------------------------------------------------------------- 1 | /** @internal */ 2 | interface LlNode { 3 | r: T; 4 | prev?: LlNode | undefined; 5 | next?: LlNode | undefined; 6 | } 7 | export { LlNode }; 8 | -------------------------------------------------------------------------------- /node/transformation/split/linked-list/linked-list-node.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | //# sourceMappingURL=linked-list-node.js.map -------------------------------------------------------------------------------- /node/transformation/split/linked-list/linked-list-node.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"linked-list-node.js","sourceRoot":"","sources":["../../../../src/transformation/split/linked-list/linked-list-node.ts"],"names":[],"mappings":""} -------------------------------------------------------------------------------- /node/transformation/split/split-by-length.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Split the given bezier curve into pieces (given as an array of parameter 3 | * `t` values) such that the longest curve length is guaranteed to be lower than 4 | * the given max length. 5 | * 6 | * @param ps an order 0,1,2 or 3 bezier curve given as an ordered array of its 7 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 8 | * @param maxLength 9 | * 10 | * @doc mdx 11 | */ 12 | declare function splitByLength(ps: number[][], maxLength: number): number[]; 13 | export { splitByLength }; 14 | -------------------------------------------------------------------------------- /node/transformation/to-string.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a 'human readable' string representation of the given bezier curve. 3 | * 4 | * @param ps a bezier curve given as an ordered array of its 5 | * control point coordinates, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 6 | * 7 | * @doc 8 | */ 9 | declare function toString(ps: number[][]): string; 10 | export { toString }; 11 | -------------------------------------------------------------------------------- /node/transformation/to-string.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns a 'human readable' string representation of the given bezier curve. 3 | * 4 | * @param ps a bezier curve given as an ordered array of its 5 | * control point coordinates, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 6 | * 7 | * @doc 8 | */ 9 | function toString(ps) { 10 | return `[${ps.map(p => `[${p.join(',')}]`).join(',')}]`; 11 | } 12 | export { toString }; 13 | //# sourceMappingURL=to-string.js.map -------------------------------------------------------------------------------- /node/transformation/to-string.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"to-string.js","sourceRoot":"","sources":["../../src/transformation/to-string.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,SAAS,QAAQ,CAAC,EAAc;IAC/B,OAAO,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AACzD,CAAC;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"} -------------------------------------------------------------------------------- /performance/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flo-bezier3-performance", 3 | "author": { 4 | "name": "Floris Steenkamp" 5 | }, 6 | "license": "MIT", 7 | "private": false, 8 | "scripts": { 9 | "build": "webpack", 10 | "start": "ts-node bezier-bezier-intersection.ts" 11 | }, 12 | "dependencies": { 13 | "flo-gauss-quadrature": "^2.1.0", 14 | "particle-swarm-optimization": "^1.0.2", 15 | "react": "^17.0.2", 16 | "react-dom": "^17.0.2" 17 | }, 18 | "devDependencies": { 19 | "@types/react": "^17.0.37", 20 | "@types/react-dom": "^17.0.11" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /performance/react-svg-tree/src/helpers/node-props.ts: -------------------------------------------------------------------------------- 1 | import { TreeGraph } from "./tree-graph.js"; 2 | 3 | 4 | interface NodeProps { 5 | node: T; 6 | x: number; 7 | y: number; 8 | /** radius */ 9 | r: number; 10 | graph: TreeGraph; 11 | } 12 | 13 | 14 | export { NodeProps } 15 | -------------------------------------------------------------------------------- /performance/react-svg-tree/src/helpers/text-label.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | interface Props { 4 | x: number; 5 | y: number; 6 | //id: any; 7 | } 8 | 9 | 10 | function TextLabel({ x, y }: Props) { 11 | 18 | {'id'} 19 | 20 | } 21 | 22 | 23 | export { TextLabel } 24 | -------------------------------------------------------------------------------- /performance/src/affine.ts: -------------------------------------------------------------------------------- 1 | import { settings } from './settings.js'; 2 | 3 | const { squashFactor, transY } = settings; 4 | 5 | 6 | function unsquashp(p: number[]): number[] { 7 | //return [p[0], p[1] * squashFactor]; 8 | return [p[0], p[1] * 1]; 9 | } 10 | 11 | function squashp(p: number[]): number[] { 12 | return [p[0], p[1] / squashFactor]; // squashFactor is a power of 2 13 | } 14 | 15 | function squash(v: number): number { 16 | return v / squashFactor; // squashFactor is a power of 2 17 | } 18 | 19 | function trans(v: number): number { 20 | return v + transY; 21 | } 22 | 23 | function untrans(v: number): number { 24 | return v - transY; 25 | } 26 | 27 | function untransp(p: number[]): number[] { 28 | return [p[0], untrans(p[1])]; 29 | } 30 | 31 | 32 | export { unsquashp, trans, untrans, untransp, squashp, squash } 33 | -------------------------------------------------------------------------------- /performance/src/draw/draw-circle.ts: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Draws a 'dot' on the given canvas. 4 | * 5 | * @param ctx 6 | * @param p 7 | */ 8 | function drawCircle( 9 | ctx: CanvasRenderingContext2D, 10 | radius: number, 11 | strokeStyle: string | undefined, 12 | fillStyle: string | undefined) { 13 | 14 | return (p: number[]) => { 15 | if (strokeStyle) { ctx.strokeStyle = strokeStyle; } 16 | if (fillStyle) { ctx.fillStyle = fillStyle; } 17 | ctx.beginPath(); 18 | ctx.arc(p[0], p[1], radius, 0, 2*Math.PI); 19 | 20 | if (strokeStyle) { 21 | ctx.stroke(); 22 | } 23 | if (fillStyle) { 24 | ctx.fill(); 25 | } 26 | } 27 | } 28 | 29 | 30 | export { drawCircle } 31 | -------------------------------------------------------------------------------- /performance/src/geo/tc-fatline.ts: -------------------------------------------------------------------------------- 1 | import { Fatline } from "../../../src/intersection/bezier-bezier-intersection-fast/debug.js" 2 | import { settings } from "../settings.js"; 3 | import { unsquashp, untransp } from '../affine.js'; 4 | 5 | 6 | const { tc } = settings; 7 | 8 | function tcFatline(fatline: Fatline): Fatline { 9 | return { 10 | psBase: fatline.psBase.map(p => tc(unsquashp(untransp(p)))), 11 | psMin: fatline.psMin.map(p => tc(unsquashp(untransp(p)))), 12 | psMax: fatline.psMax.map(p => tc(unsquashp(untransp(p)))) 13 | } 14 | } 15 | 16 | export { tcFatline } 17 | -------------------------------------------------------------------------------- /performance/src/geo/tc-geo.ts: -------------------------------------------------------------------------------- 1 | import { settings } from "../settings.js"; 2 | import { unsquashp, untransp } from '../affine.js'; 3 | 4 | 5 | const { tc } = settings; 6 | 7 | 8 | function tcGeo(hq: number[][]): number[][] { 9 | 10 | const [p0, p11, p12, p2] = hq; 11 | 12 | return [ 13 | tc(unsquashp(untransp(p0))), 14 | tc(unsquashp(untransp(p11))), 15 | tc(unsquashp(untransp(p12))), 16 | tc(unsquashp(untransp(p2))) 17 | ]; 18 | } 19 | 20 | 21 | export { tcGeo } 22 | -------------------------------------------------------------------------------- /performance/src/geo/tc-ps.ts: -------------------------------------------------------------------------------- 1 | import { settings } from "../settings.js"; 2 | import { unsquashp, untransp } from '../affine.js'; 3 | 4 | 5 | const { tc } = settings; 6 | 7 | 8 | function tcPs(ps: number[][]): number[][] { 9 | return ps.map(p => tc(unsquashp(untransp(p)))); 10 | } 11 | 12 | 13 | export { tcPs } 14 | -------------------------------------------------------------------------------- /performance/src/get-pss/rand-on-grid.ts: -------------------------------------------------------------------------------- 1 | import { reduceSignificand } from "double-double"; 2 | 3 | 4 | function toGrid( 5 | a: number, 6 | expMax: number, 7 | significantFigures: number): number { 8 | 9 | let expA = Math.floor(Math.log2(Math.abs(a))); 10 | let expDif = expMax - expA; 11 | let newSig = significantFigures - expDif + 1; 12 | 13 | if (newSig <= 0) { return 0; } 14 | 15 | let res = reduceSignificand(a, newSig); 16 | 17 | return res; 18 | } 19 | 20 | 21 | function randOnGrid(max: number, maxBitLength: number) { 22 | if (maxBitLength === 53) { return () => max * Math.random(); } 23 | const expMax = Math.ceil(Math.log2(Math.max(max))); 24 | return () => toGrid(max * Math.random(), expMax, maxBitLength); 25 | } 26 | 27 | export { randOnGrid } 28 | -------------------------------------------------------------------------------- /performance/src/log.ts: -------------------------------------------------------------------------------- 1 | 2 | function log(a: T): T { 3 | console.log(a); 4 | 5 | return a; 6 | } 7 | 8 | 9 | export { log } 10 | -------------------------------------------------------------------------------- /performance/src/native/draw-intersections.ts: -------------------------------------------------------------------------------- 1 | import { X } from "../../../src/index.js"; 2 | import { settings } from '../settings.js'; 3 | import { draw, ctx } from '../draw-stuff.js'; 4 | import { unsquashp, untransp } from '../affine.js'; 5 | 6 | 7 | const { tc, num } = settings; 8 | const { dot_, box_ } = draw(ctx); 9 | 10 | 11 | function drawIntersections(xs: X[]) { 12 | //if (!ris) { return; } 13 | //ris.map(t => dot_1(tc(evaluate(ps2, mid(t))))); 14 | 15 | xs.map(x => { 16 | const tl = tc(unsquashp(untransp(x.box[0]))); 17 | const br = tc(unsquashp(untransp(x.box[1]))); 18 | //dot_(tc(unsquashp(untransp(p)))); 19 | box_([tl,br]); 20 | //console.log(tl,br) 21 | dot_(tl); 22 | dot_(br); 23 | }); 24 | } 25 | 26 | 27 | export { drawIntersections } 28 | -------------------------------------------------------------------------------- /performance/src/native/pre-filter.ts: -------------------------------------------------------------------------------- 1 | 2 | function preFilter() { 3 | //const b1 = getControlPointBox(ps1); 4 | //const b2 = getControlPointBox(ps2); 5 | //if (!areBoxesIntersecting_(b1,b2)) { 6 | // //console.log('cc') 7 | // continue; 8 | //} 9 | //const b1 = getBoundingBoxTight(ps1); 10 | //const b2 = getBoundingBoxTight(ps2); 11 | //if (!doConvexPolygonsIntersect(b1,b2,true)) { 12 | // //console.log('cc') 13 | // continue; 14 | //} 15 | } 16 | 17 | 18 | export { preFilter } 19 | -------------------------------------------------------------------------------- /performance/src/pre-filter.ts: -------------------------------------------------------------------------------- 1 | function preFilter() { 2 | //const b1 = getControlPointBox(ps1); 3 | //const b2 = getControlPointBox(ps2); 4 | //if (!areBoxesIntersecting_(b1,b2)) { 5 | // filtered++; 6 | // continue; 7 | //} 8 | //const b1 = getBoundingBoxTight(ps1); 9 | //const b2 = getBoundingBoxTight(ps2); 10 | //if (!doConvexPolygonsIntersect(b1,b2,true)) { 11 | // filtered++; 12 | // continue; 13 | //} 14 | } 15 | 16 | 17 | export { preFilter } 18 | -------------------------------------------------------------------------------- /performance/src/setup-global.ts: -------------------------------------------------------------------------------- 1 | import { __Debug__ } from "../../src/intersection/bezier-bezier-intersection-fast/debug"; 2 | 3 | 4 | (globalThis as any as { __debug__: Partial<__Debug__> | undefined}).__debug__ = 5 | { already: false, uid: 0, maxItersCount: 0 }; 6 | 7 | const DUMMY = 1; 8 | 9 | 10 | export { DUMMY } -------------------------------------------------------------------------------- /performance/src/to-grid.ts: -------------------------------------------------------------------------------- 1 | import { reduceSignificand } from "double-double"; 2 | 3 | const { floor, log2, abs } = Math; 4 | 5 | 6 | function toGrid( 7 | a: number, 8 | expMax: number, 9 | significantBits: number): number { 10 | 11 | let expA = floor(log2(abs(a))); 12 | let expDif = expMax - expA; 13 | let newSig = significantBits - expDif + 1; 14 | 15 | if (newSig <= 0) { return 0; } 16 | 17 | return reduceSignificand(a, newSig); 18 | } 19 | 20 | 21 | export { toGrid } 22 | -------------------------------------------------------------------------------- /performance/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "charset": "utf8", 4 | "strict": true, 5 | "module": "es2020", 6 | "target": "es2020", 7 | "declaration": false, 8 | "noEmitOnError": true, 9 | "sourceMap": false, 10 | "moduleResolution": "node", 11 | "jsx": "react" 12 | }, 13 | "include": [ 14 | "src/test-bezier-intersection.ts" 15 | ], 16 | "exclude": [ 17 | "node_modules", 18 | "src/experiments", 19 | "src/experiments-new", 20 | ] 21 | } -------------------------------------------------------------------------------- /src/add-1-ulp.ts: -------------------------------------------------------------------------------- 1 | const { EPSILON: eps } = Number; 2 | 3 | const u = eps/2; 4 | const es = (eps**2)/2; 5 | const ups = u + es; 6 | 7 | 8 | /** 9 | * Add one unit in the last place (ulp) to the given number 10 | * 11 | * * subnormal numbers (and 0) are returned unaltered 12 | * @internal 13 | */ 14 | function add1Ulp(n: number) { 15 | return n > 0 ? n + n*ups : n - n*ups; 16 | } 17 | 18 | 19 | export { add1Ulp } 20 | -------------------------------------------------------------------------------- /src/bezier-piece.ts: -------------------------------------------------------------------------------- 1 | 2 | /** @internal but kept for backwards compatibility */ 3 | interface BezierPiece { 4 | readonly ps: number[][]; 5 | readonly ts: number[]; 6 | } 7 | 8 | 9 | export type { BezierPiece } 10 | -------------------------------------------------------------------------------- /src/error-analysis/error-analysis.ts: -------------------------------------------------------------------------------- 1 | 2 | const u = Number.EPSILON / 2; 3 | const uu = u*u; 4 | 5 | /** @internal */ 6 | function γ(n: number): number { 7 | const nu = n*u; 8 | return nu/(1-nu); 9 | } 10 | 11 | 12 | /** @internal */ 13 | function γγ(n: number): number { 14 | const nuu = n*uu; 15 | return nuu/(1-nuu); 16 | } 17 | 18 | 19 | export { γ, γγ } 20 | 21 | 22 | γ(1); //=> 1.1102230246251568e-16 23 | γγ(3); //=> 3.697785493223493e-32 24 | -------------------------------------------------------------------------------- /src/error-analysis/max-abs-coordinate.ts: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Returns the maximum absolute value of the coordinates of the control points 4 | * of the given bezier curve. 5 | * 6 | * @param ps an order 1,2 or 3 bezier curve given as an ordered array of its 7 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 8 | * 9 | * @doc 10 | */ 11 | function maxAbsCoordinate(ps: number[][]) { 12 | let m = Number.NEGATIVE_INFINITY; 13 | for (let i=0; i m) { m = absX; } 18 | if (absY > m) { m = absY; } 19 | } 20 | 21 | return m; 22 | } 23 | 24 | 25 | export { maxAbsCoordinate } 26 | -------------------------------------------------------------------------------- /src/global-properties/bounds/bounds.ts: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * A bound used in specifying bounding boxes of bezier curves. 4 | */ 5 | interface Bound { 6 | /** a certified (max `4*eps` for `t ∈ [0,1]`) `t` range containing the bound */ 7 | ts: number[]; 8 | /** a certified `box` containing the bound */ 9 | box: number[][]; 10 | } 11 | 12 | 13 | /** 14 | * x-coordinate bounds used in specifying bounding boxes of bezier curves. 15 | */ 16 | interface XBounds { 17 | minX: Bound; 18 | maxX: Bound; 19 | } 20 | 21 | 22 | /** 23 | * y-coordinate bounds used in specifying bounding boxes of bezier curves. 24 | */ 25 | interface YBounds { 26 | minY: Bound; 27 | maxY: Bound; 28 | } 29 | 30 | 31 | export type { Bound, XBounds, YBounds } 32 | -------------------------------------------------------------------------------- /src/global-properties/bounds/get-bounding-hull.ts: -------------------------------------------------------------------------------- 1 | import { grahamScan } from 'flo-graham-scan'; 2 | 3 | 4 | /** 5 | * Finds the convex hull of the given set of 2d points using the 6 | * Graham Scan algorithm and returns the hull as an array of points. 7 | * 8 | * * see https://en.wikipedia.org/wiki/Graham_scan 9 | * 10 | * **exact**: this algorithm is robust via adaptive infinite precision floating 11 | * point arithmetic. 12 | * 13 | * @param ps a set of points, e.g. a bezier curve, e.g. [[0,0],[1,1],[2,1],[2,0]] 14 | * @param includeAllBoundaryPoints set this to `true` to if all boundary points 15 | * should be returned, even redundant ones; defaults to `false` 16 | * 17 | * @dox mdx 18 | */ 19 | const getBoundingHull = grahamScan; 20 | 21 | 22 | export { getBoundingHull } 23 | -------------------------------------------------------------------------------- /src/global-properties/classification/is-really-point.ts: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Returns `true` if the given bezier curve has all control points coincident, 4 | * `false` otherwise. 5 | * 6 | * @param ps an order 0,1,2 or 3 bezier curve given as an array of its control 7 | * points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 8 | * 9 | * @doc 10 | */ 11 | function isReallyPoint(ps: number[][]): boolean { 12 | const x = ps[0][0]; 13 | const y = ps[0][1]; 14 | 15 | for (let i=1; i 0n ? 1n : v < 0n ? -1n : 0n; 5 | } 6 | 7 | 8 | export { bSign } 9 | -------------------------------------------------------------------------------- /src/intersection/get-endpoint-intersections/b-sqrt.ts: -------------------------------------------------------------------------------- 1 | 2 | const { round, sqrt } = Math; 3 | 4 | 5 | /** 6 | * Returns the square root of a bigint. 7 | * 8 | * * see https://stackoverflow.com/a/53684036/2010061 9 | * 10 | * * **precondition**: the given bigint must be a perfect square 11 | * 12 | * @internal 13 | */ 14 | function bSqrt(v: bigint): bigint { 15 | if (v <= 1n) { 16 | if (v < 0n) { 17 | throw new Error('square root of negative numbers are not allowed'); 18 | } 19 | return v; 20 | } 21 | 22 | let x0 = BigInt(round(sqrt(Number(v)))); 23 | 24 | while (true) { 25 | const x1 = (x0 + v/x0) >> 1n; 26 | if (x1 === x0) { 27 | return x0; 28 | } 29 | x0 = x1; 30 | } 31 | } 32 | 33 | 34 | export { bSqrt } 35 | -------------------------------------------------------------------------------- /src/intersection/get-endpoint-intersections/bigint-to-expansion.ts: -------------------------------------------------------------------------------- 1 | import { eCompress } from "big-float-ts"; 2 | 3 | 4 | const maxSafe = BigInt(2**53); 5 | /** 6 | * Returns the [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf) expansion of the given bigint. 7 | * 8 | * * it is assumed that the given bigint doesn't cause floating point overflow 9 | * 10 | * @internal 11 | */ 12 | function bigintToExpansion(b: bigint): number[] { 13 | if (b === 0n) { return [0]; } 14 | const e: number[] = []; 15 | let i = 0; 16 | let q = b; 17 | while (q !== 0n) { 18 | q = b / maxSafe; 19 | const r = b % maxSafe; 20 | e.push(Number(r)*2**(i*53)); 21 | b = q; 22 | i++; 23 | } 24 | 25 | return eCompress(e); 26 | } 27 | 28 | 29 | export { bigintToExpansion } 30 | -------------------------------------------------------------------------------- /src/intersection/get-endpoint-intersections/ensure-range.ts: -------------------------------------------------------------------------------- 1 | const eps = Number.EPSILON; 2 | const u = eps/2; 3 | 4 | 5 | /** 6 | * @param t 7 | * @param min1Sign 8 | * 9 | * @internal 10 | */ 11 | function ensureRange( 12 | t: number, 13 | min1Sign: number): number { 14 | 15 | return ( 16 | min1Sign < 0 17 | ? (t < 1 ? t : 1 - u) 18 | : min1Sign === 0 19 | ? 1 20 | : (t > 1 ? t : 1 + eps) 21 | ); 22 | } 23 | 24 | 25 | export { ensureRange } 26 | -------------------------------------------------------------------------------- /src/intersection/get-endpoint-intersections/er-compare.ts: -------------------------------------------------------------------------------- 1 | import { eCompare, eMult, eSign } from "big-float-ts"; 2 | 3 | 4 | /** 5 | * Compares two expansion rationals. 6 | * 7 | * @internal 8 | */ 9 | function erCompare(a: number[][], b: number[][]) { 10 | return ( 11 | eCompare(eMult(a[0],b[1]), eMult(a[1],b[0])) * 12 | eSign(a[1]) * 13 | eSign(b[1]) 14 | ); 15 | } 16 | 17 | 18 | export { erCompare } 19 | -------------------------------------------------------------------------------- /src/intersection/get-endpoint-intersections/er-estimate.ts: -------------------------------------------------------------------------------- 1 | import { eDiv, eEstimate } from "big-float-ts"; 2 | 3 | 4 | /** 5 | * Estimates the result of the given expansion rational. 6 | * 7 | * * the sign of the returned result is guaranteed to be correct 8 | * * the result is guaranteed accurate to within 2 ulps 9 | * 10 | * @param a 11 | * 12 | * @internal 13 | */ 14 | function erEstimate(a: number[][]): number { 15 | return eEstimate(eDiv(a[0],a[1],2)); 16 | } 17 | 18 | 19 | export { erEstimate } 20 | -------------------------------------------------------------------------------- /src/intersection/get-endpoint-intersections/er-sign.ts: -------------------------------------------------------------------------------- 1 | import { eSign } from "big-float-ts"; 2 | 3 | 4 | /** 5 | * Returns the sign of the given expansion rational. 6 | * 7 | * @param a 8 | * 9 | * @internal 10 | */ 11 | function erSign(a: number[][]) { 12 | return eSign(a[0]) * eSign(a[1]); 13 | } 14 | 15 | 16 | export { erSign } 17 | -------------------------------------------------------------------------------- /src/intersection/get-endpoint-intersections/get-ab1.ts: -------------------------------------------------------------------------------- 1 | import { getAB } from "./get-ab.js"; 2 | import { getTransform1 } from "./get-transform-1.js"; 3 | 4 | 5 | /** @internal */ 6 | const getAB1 = getAB(getTransform1); 7 | 8 | 9 | export { getAB1 } 10 | -------------------------------------------------------------------------------- /src/intersection/get-endpoint-intersections/get-ab3.ts: -------------------------------------------------------------------------------- 1 | import { getAB } from "./get-ab.js"; 2 | import { getTransform3 } from "./get-transform-3.js"; 3 | 4 | 5 | /** @internal */ 6 | const getAB3 = getAB(getTransform3); 7 | 8 | 9 | export { getAB3 } 10 | -------------------------------------------------------------------------------- /src/intersection/get-endpoint-intersections/sum-bigints.ts: -------------------------------------------------------------------------------- 1 | 2 | /** @internal */ 3 | function sumBigints(vs: bigint[]) { 4 | let total = 0n; 5 | for (let i=0; i length([0,t], ps); 22 | 23 | return brent(t => (lenAtT(t) - s), 0, 1.125); 24 | } 25 | 26 | 27 | export { getTAtLength } 28 | -------------------------------------------------------------------------------- /src/simultaneous-properties/closest-and-furthest-point-on-bezier/foot-and-endpoint-info.ts: -------------------------------------------------------------------------------- 1 | import { RootInterval } from "flo-poly"; 2 | 3 | 4 | type FootAndEndpointInfo = { 5 | p: number[]; 6 | t: number; 7 | d: number; 8 | box: number[][]; 9 | ri: RootInterval; 10 | dSquaredI: number[] 11 | } 12 | 13 | 14 | export { FootAndEndpointInfo } 15 | -------------------------------------------------------------------------------- /src/simultaneous-properties/closest-and-furthest-point-on-bezier/get-coeffs/double/get-footpoint-poly-1.ts: -------------------------------------------------------------------------------- 1 | 2 | /** @internal */ 3 | function getFootpointPoly1( 4 | ps: number[][], p: number[]) { 5 | 6 | const [[x0, y0], [x1, y1]] = ps; 7 | const [xp, yp] = p; 8 | 9 | const xx0 = x0 - xp; 10 | const xx1 = x1 - xp; 11 | const yy0 = y0 - yp; 12 | const yy1 = y1 - yp; 13 | 14 | const x01 = xx0*xx1; 15 | const y01 = yy0*yy1; 16 | 17 | const s1 = x01 + y01; 18 | const s2 = yy0*yy0 + xx0*xx0; 19 | 20 | const t1 = (xx1*xx1 + yy1*yy1) + (s2 - 2*s1); 21 | const t0 = s1 - s2; 22 | 23 | return [t1,t0]; 24 | } 25 | 26 | 27 | export { getFootpointPoly1 } 28 | -------------------------------------------------------------------------------- /src/simultaneous-properties/closest-distance-between-beziers/distance-interval.ts: -------------------------------------------------------------------------------- 1 | 2 | /** @internal */ 3 | interface DistanceInterval { 4 | tS: number; 5 | tE: number; 6 | pL: number[]; 7 | pR: number[]; 8 | dL: number; // distance left 9 | dR: number; // distance right 10 | eL: number; // error left 11 | eR: number; // error right 12 | } 13 | 14 | 15 | export { DistanceInterval } 16 | -------------------------------------------------------------------------------- /src/simultaneous-properties/closest-distance-between-beziers/get-min-max-distance.ts: -------------------------------------------------------------------------------- 1 | import { DistanceInterval } from "./distance-interval"; 2 | 3 | const { min, max } = Math; 4 | 5 | 6 | /** @internal */ 7 | function getMaxDistance(i: DistanceInterval) { 8 | return max(i.dL + i.eL, i.dR + i.eR); 9 | } 10 | 11 | 12 | /** @internal */ 13 | function getMinDistance(i: DistanceInterval) { 14 | return min(i.dL - i.eL, i.dR - i.eR); 15 | } 16 | 17 | 18 | export { getMaxDistance, getMinDistance } -------------------------------------------------------------------------------- /src/simultaneous-properties/closest-distance-between-beziers/points-with-distance.ts: -------------------------------------------------------------------------------- 1 | 2 | /** @internal */ 3 | interface PointsWithDistance { 4 | pA: { p: number[]; t: number; }, 5 | pB: { p: number[]; t: number; }, 6 | d: number; 7 | } 8 | 9 | 10 | 11 | export { PointsWithDistance } 12 | -------------------------------------------------------------------------------- /src/simultaneous-properties/equal.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Returns `true` if the two given bezier curves are exactly equal when compared 3 | * by value (deep equality), `false` otherwise 4 | * 5 | * @param ps1 an order 0,1,2 or 3 bezier curve given as an ordered array of its 6 | * control points, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 7 | * @param ps2 another bezier curve 8 | * 9 | * @doc 10 | */ 11 | function equal( 12 | ps1: number[][], 13 | ps2: number[][]): boolean { 14 | 15 | if (ps1 === ps2) { return true; } 16 | 17 | if (ps1.length !== ps2.length) { return false; } 18 | 19 | for (let i=0; i 0 ? n - n*ups : n + n*ups; 16 | } 17 | 18 | 19 | export { sub1Ulp } 20 | -------------------------------------------------------------------------------- /src/transformation/clone.ts: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Returns a clone of the given cubic bezier (with a different reference). 4 | * 5 | * @param ps a bezier curve given as an ordered array of its 6 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 7 | * 8 | * @doc 9 | */ 10 | function clone(ps: number[][]) { 11 | const ps_: number[][] = []; 12 | for (let i=0; i ps.slice().reverse() 7 | * ``` 8 | * 9 | * @param ps a bezier curve given as an ordered array of its 10 | * control point coordinates, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 11 | * 12 | * @doc 13 | */ 14 | function reverse(ps: number[][]) { 15 | return ps.slice().reverse(); 16 | } 17 | 18 | 19 | export { reverse } 20 | -------------------------------------------------------------------------------- /src/transformation/split/linked-list/linked-list-node.ts: -------------------------------------------------------------------------------- 1 | 2 | /** @internal */ 3 | interface LlNode { 4 | r: T; 5 | prev?: LlNode | undefined; 6 | next?: LlNode | undefined; 7 | } 8 | 9 | 10 | export { LlNode } 11 | -------------------------------------------------------------------------------- /src/transformation/to-estimation.ts: -------------------------------------------------------------------------------- 1 | import { eEstimate } from "big-float-ts"; 2 | 3 | const estimate = eEstimate; 4 | 5 | 6 | /** 7 | * Returns the resulting bezier curve when rounding each control point 8 | * coordinate (given as [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf) 9 | * expansions) of the given bezier curve to double precision. 10 | * 11 | * @param ps a bezier curve given as an ordered array of its 12 | * control point coordinates, e.g. `[[0,0], [1,1], [2,1], [2,0]]` 13 | * 14 | * @internal 15 | */ 16 | function toEstimation(ps: number[][][]): number[][] { 17 | return ps.map(p => p.map(c => estimate(c))); 18 | } 19 | 20 | 21 | export { toEstimation } 22 | -------------------------------------------------------------------------------- /src/transformation/to-expansion.ts: -------------------------------------------------------------------------------- 1 | 2 | /** @internal */ 3 | function toExpansion(ps: number[][]): number[][][] { 4 | return ps.map(p => p.map(c => [c])); 5 | } 6 | 7 | 8 | export { toExpansion } 9 | -------------------------------------------------------------------------------- /src/transformation/to-string.ts: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Returns a 'human readable' string representation of the given bezier curve. 4 | * 5 | * @param ps a bezier curve given as an ordered array of its 6 | * control point coordinates, e.g. `[[0,0],[1,1],[2,1],[2,0]]` 7 | * 8 | * @doc 9 | */ 10 | function toString(ps: number[][]): string { 11 | return `[${ps.map(p => `[${p.join(',')}]`).join(',')}]`; 12 | } 13 | 14 | 15 | export { toString } 16 | -------------------------------------------------------------------------------- /test/chai-extensions.d.ts: -------------------------------------------------------------------------------- 1 | import { ObjOrArray } from "./helpers/obj-or-array"; 2 | 3 | 4 | declare module Chai { 5 | interface Assertion { 6 | /** 7 | * @param ulps If a number then 2\*\*1 means last bit, 2\*\*2 means last 2 bits, etc... 8 | * else if an array containing a single number then 1 means 1 eps, 2 means 2 eps, etc... 9 | */ 10 | nearly: (ulps: number | number[], value: ObjOrArray) => void; 11 | } 12 | } -------------------------------------------------------------------------------- /test/create/cubic-through-point-given013.spec.ts: -------------------------------------------------------------------------------- 1 | import { assert, expect, use } from 'chai'; 2 | import { describe } from 'mocha'; 3 | import { cubicThroughPointGiven013 } from '../../src/index.js'; 4 | import { nearly } from '../helpers/chai-extend-nearly.js'; 5 | 6 | use(nearly); 7 | 8 | describe('cubicThroughPointGiven013', function() { 9 | it('should create the correct cubic though a given point given control points 0, 1 and 3 at time `t`', 10 | function() { 11 | expect(cubicThroughPointGiven013( 12 | [[1,1], [10.53125,4.8125], [18,0.5]], 13 | [14.6875,3.34375], 14 | 0.75 15 | // @ts-ignore 16 | )).to.be.nearly(2**4, 17 | [[1, 1], [10.53125, 4.8125], [13.26736111111111, 5.784722222222222], [18, 0.5]] 18 | ); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /test/create/generate-cusp-at-half-t.spec.ts: -------------------------------------------------------------------------------- 1 | import { assert, expect, use } from 'chai'; 2 | import { describe } from 'mocha'; 3 | import { generateCuspAtHalf3 } from '../../src/index.js'; 4 | import { nearly } from '../helpers/chai-extend-nearly.js'; 5 | 6 | use(nearly); 7 | 8 | 9 | describe('generateCuspAtHalf3', function() { 10 | it('it should generate the correct cubic curve with a cusp at `t === 0.5`', 11 | function() { 12 | // @ts-ignore - otherwise TypeScript gives an error on nearly 13 | expect(generateCuspAtHalf3([0,0], [2,2], [3,0])).to.be.nearly(2**4, 14 | [ 15 | [0,0], 16 | [3.6666666666666666, 2.6666666666666666], 17 | [0.6666666666666666, 2.6666666666666666], 18 | [3,0] 19 | ] 20 | ); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /test/global-properties/bounds/get-control-point-box.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect, assert } from 'chai'; 2 | import { describe } from 'mocha'; 3 | import { getControlPointBox } from '../../../src/index.js'; 4 | import { getRandomCubic } from '../../helpers/get-random-bezier.js'; 5 | 6 | 7 | describe('getControlPointBox', function() { 8 | it('it should get the correct control point bounding box for some cubic beziers', 9 | function() { 10 | const ps0 = getRandomCubic(0); 11 | const box = getControlPointBox(ps0); 12 | expect(box).to.be.eql([ 13 | [-108.49686506776892, -112.1975403532909], 14 | [124.76385737178956, 52.32750125849648] 15 | ]); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /test/global-properties/classification/is-quad-obtuse.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect, assert } from 'chai'; 2 | import { describe } from 'mocha'; 3 | import { isQuadObtuse } from '../../../src/index.js'; 4 | import { getRandomQuad } from '../../helpers/get-random-bezier.js'; 5 | 6 | 7 | describe('isQuadObtuse', function() { 8 | it('it should correctly determined if the given quadratic bezier curve is obtuse or acute', 9 | function() { 10 | expect(isQuadObtuse([[0,0],[1,1],[2,3]])).to.be.false; 11 | 12 | const expecteds = [false, false, false, false, true, false, false, true, true, true]; 13 | for (let i=0; i<10; i++) { 14 | const ps = getRandomQuad(i); 15 | if (expecteds[i]) { 16 | expect(isQuadObtuse(ps)).to.be.true; 17 | } else { 18 | expect(isQuadObtuse(ps)).to.be.false; 19 | } 20 | } 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /test/global-properties/classification/is-really-point.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect, assert } from 'chai'; 2 | import { describe } from 'mocha'; 3 | import { isReallyPoint } from '../../../src/index.js'; 4 | 5 | 6 | describe('isReallyPoint', function() { 7 | it('it should check correctly if a line is really a point in disguise', 8 | function() { 9 | { 10 | const ps = [[0,0],[1,1]]; 11 | expect(isReallyPoint(ps)).to.be.false; 12 | } 13 | 14 | { 15 | const ps = [[0,0],[0,0.000000000000000000000000000000000000000001]]; 16 | expect(isReallyPoint(ps)).to.be.false; 17 | } 18 | 19 | { 20 | const ps = [[2,2],[2,2]]; 21 | expect(isReallyPoint(ps)).to.be.true; 22 | } 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /test/global-properties/classification/is-self-overlapping.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect, assert } from 'chai'; 2 | import { describe } from 'mocha'; 3 | import { isSelfOverlapping } from '../../../src/index.js'; 4 | import { getRandomCubic } from '../../helpers/get-random-bezier.js'; 5 | 6 | 7 | describe('isSelfOverlapping', function() { 8 | it('it should check correctly for self-overlapping curves', 9 | function() { 10 | for (let i=0; i<10; i++) { 11 | const ps = getRandomCubic(i); 12 | 13 | expect(isSelfOverlapping(ps)).to.be.false; 14 | } 15 | 16 | expect(isSelfOverlapping([[0,0],[1,1],[2,2]])).to.be.false; 17 | expect(isSelfOverlapping([[0,0],[1,1],[0.1,0.1]])).to.be.true; 18 | expect(isSelfOverlapping([[2,2],[1,1],[0,0]])).to.be.false; 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /test/global-properties/length/length-approx.spec.ts: -------------------------------------------------------------------------------- 1 | // `lengthApprox` is already adequately tested by `length` 2 | -------------------------------------------------------------------------------- /test/global-properties/length/total-length.spec.ts: -------------------------------------------------------------------------------- 1 | // `totalLength` is already adequately tested by `length` 2 | -------------------------------------------------------------------------------- /test/helpers/intersection-fast/check-results.ts: -------------------------------------------------------------------------------- 1 | import { expect } from "chai"; 2 | 3 | 4 | function checkResults( 5 | ds: number[], 6 | total: number) { 7 | 8 | let sum = 0; 9 | let max = 0; 10 | for (const d of ds) { 11 | sum += d; 12 | if (d > max) { max = d; } 13 | } 14 | const mean = sum / total; 15 | let sumSquaredDiffs = 0; 16 | for (const d of ds) { 17 | sumSquaredDiffs += (mean - d)**2; 18 | } 19 | const stdDev = Math.sqrt(sumSquaredDiffs / total); 20 | 21 | // accuracy to be to within one billionth of the max coordinate 22 | expect(max).to.be.lessThan(1e-9); 23 | 24 | //'xs: ' + total;//? 25 | //'max: ' + max;//? 26 | //'max/eps: ' + max/eps;//? 27 | //'mean: ' + mean;//? 28 | //'stdDev: ' + stdDev;//? 29 | } 30 | 31 | 32 | export { checkResults } 33 | -------------------------------------------------------------------------------- /test/helpers/intersection-fast/native.ts: -------------------------------------------------------------------------------- 1 | import { bezierBezierIntersection, X } from "../../../src/index.js"; 2 | 3 | 4 | function native(pss: number[][][]): X[][] { 5 | const xss: X[][] = []; 6 | 7 | for (let i=0; i x.ri1.tS); 9 | for (let t of tSs) { 10 | if (t < current) { 11 | return false; 12 | } 13 | current = t; 14 | } 15 | 16 | return true; 17 | } 18 | 19 | 20 | export { areIntersectionsOrdered } 21 | -------------------------------------------------------------------------------- /test/helpers/intersection/swap-intersections.ts: -------------------------------------------------------------------------------- 1 | import { X } from "../../../src/index.js"; 2 | 3 | 4 | function swapIntersections(xs: X[]): X[] { 5 | return xs.map(x => ({ 6 | ...x, 7 | t1: x.t2, 8 | ri1: x.ri2, 9 | t2: x.t1, 10 | ri2: x.ri1 11 | })); 12 | } 13 | 14 | 15 | export { swapIntersections } 16 | -------------------------------------------------------------------------------- /test/helpers/obj-or-array.ts: -------------------------------------------------------------------------------- 1 | 2 | type ObjOrArray = 3 | | T 4 | | ObjOrArray[] 5 | | { [key:string]: ObjOrArray }; 6 | 7 | 8 | export { ObjOrArray } 9 | -------------------------------------------------------------------------------- /test/helpers/rad-to-deg.ts: -------------------------------------------------------------------------------- 1 | 2 | const 𝜋 = Math.PI; 3 | 4 | 5 | function radToDeg(rad: number): number { 6 | return rad / (2*𝜋) * 360; 7 | } 8 | 9 | 10 | export { radToDeg } 11 | -------------------------------------------------------------------------------- /test/helpers/random-rotate-and-translate.ts: -------------------------------------------------------------------------------- 1 | import { rotate, translate } from "flo-vector2d"; 2 | import { randomOnGrid } from "./random-on-grid.js"; 3 | 4 | 5 | function randomRotateAndTranslate(seed: number) { 6 | const randomOnGrid_ = randomOnGrid(1, 53); 7 | return (ps: number[][]): number[][] => { 8 | const angle = 10*randomOnGrid_(seed*3); 9 | const x = 10*randomOnGrid_((seed*3)+1); 10 | const y = 10*randomOnGrid_((seed*3)+2); 11 | const sinθ = Math.sin(angle); 12 | const cosθ = Math.cos(angle); 13 | return ps.map(p => translate([x,y])(rotate(sinθ, cosθ)(p))); 14 | } 15 | } 16 | 17 | 18 | export { randomRotateAndTranslate } 19 | -------------------------------------------------------------------------------- /test/helpers/random-translate.ts: -------------------------------------------------------------------------------- 1 | import { translate } from "flo-vector2d"; 2 | import { randomOnGrid } from "./random-on-grid.js"; 3 | 4 | 5 | function randomTranslate(seed: number) { 6 | const randomOnGrid_ = randomOnGrid(1, 53); 7 | return (ps: number[][]): number[][] => { 8 | const x = 10*randomOnGrid_((seed*3)+1); 9 | const y = 10*randomOnGrid_((seed*3)+2); 10 | return ps.map(p => translate([x,y])(p)); 11 | } 12 | } 13 | 14 | 15 | export { randomTranslate } 16 | -------------------------------------------------------------------------------- /test/helpers/reverse-bound-ts.ts: -------------------------------------------------------------------------------- 1 | import { XBounds, YBounds } from "../../src/index.js"; 2 | 3 | 4 | function reverseXBoundTs(xBounds: XBounds): XBounds { 5 | return { 6 | minX: { ts: xBounds.minX.ts.map(t => 1 - t), box: xBounds.minX.box }, 7 | maxX: { ts: xBounds.maxX.ts.map(t => 1 - t), box: xBounds.maxX.box } 8 | } 9 | } 10 | 11 | 12 | function reverseYBoundTs(yBounds: YBounds): YBounds { 13 | return { 14 | minY: { ts: yBounds.minY.ts.map(t => 1 - t), box: yBounds.minY.box }, 15 | maxY: { ts: yBounds.maxY.ts.map(t => 1 - t), box: yBounds.maxY.box } 16 | } 17 | } 18 | 19 | 20 | export { reverseXBoundTs, reverseYBoundTs } 21 | -------------------------------------------------------------------------------- /test/helpers/to-grid.ts: -------------------------------------------------------------------------------- 1 | import { reduceSignificand } from "double-double"; 2 | 3 | const { floor, log2, abs } = Math; 4 | 5 | 6 | function toGrid( 7 | a: number, 8 | expMax: number, 9 | significantBits: number): number { 10 | 11 | let expA = floor(log2(abs(a))); 12 | let expDif = expMax - expA; 13 | let newSig = significantBits - expDif + 1; 14 | 15 | if (newSig <= 0) { return 0; } 16 | 17 | return reduceSignificand(a, newSig); 18 | } 19 | 20 | 21 | export { toGrid } 22 | -------------------------------------------------------------------------------- /test/intersection/bezier-bezier-intersection/b-sign.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect, use } from 'chai'; 2 | import { bSign } from '../../../src/intersection/get-endpoint-intersections/b-sign.js'; 3 | import { nearly } from '../../helpers/chai-extend-nearly.js'; 4 | 5 | use(nearly); 6 | 7 | 8 | describe('bSign', function() { 9 | it('it should ensure the bigint sign helper function return correct results', 10 | function() { 11 | expect(bSign(2n)).to.eql(1n); 12 | expect(bSign(-2n)).to.eql(-1n); 13 | expect(bSign(-0n)).to.eql(0n); 14 | expect(bSign(0n)).to.eql(0n); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /test/intersection/bezier-bezier-intersection/bigint-to-expansion.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect, use } from 'chai'; 2 | import { bigintToExpansion } from '../../../src/intersection/get-endpoint-intersections/bigint-to-expansion.js'; 3 | import { nearly } from '../../helpers/chai-extend-nearly.js'; 4 | 5 | use(nearly); 6 | 7 | 8 | describe('bigintToExpansion', function() { 9 | it('it should ensure the bigint to Shewchuk expansion helper function return correct results', 10 | function() { 11 | { 12 | expect(bigintToExpansion(1n)).to.eql([1]); 13 | expect(bigintToExpansion(-0n)).to.eql([0]); 14 | } 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /test/intersection/bezier-bezier-intersection/ensure-range.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect, use } from 'chai'; 2 | import { ensureRange } from '../../../src/intersection/get-endpoint-intersections/ensure-range.js'; 3 | import { nearly } from '../../helpers/chai-extend-nearly.js'; 4 | 5 | use(nearly); 6 | 7 | 8 | describe('ensureRange', function() { 9 | it('it should ensure the `ensureRange` helper function return correct results', 10 | function() { 11 | expect(ensureRange(1,-1)).to.eql(0.9999999999999999); 12 | expect(ensureRange(1.0001,-1)).to.eql(0.9999999999999999); 13 | expect(ensureRange(1.0001,1)).to.eql(1.0001); 14 | expect(ensureRange(0.9999999999999,1)).to.eql(1.0000000000000002); 15 | expect(ensureRange(0.9999999999999,0)).to.eql(1); 16 | expect(ensureRange(1.0000000000000002,0)).to.eql(1); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /test/local-properties-at-t/evaluate-2nd-derivative/double/evaluate-2nd-derivative-at-0.spec.ts: -------------------------------------------------------------------------------- 1 | // See 'evaluate-2nd-derivative.spec.ts' 2 | -------------------------------------------------------------------------------- /test/local-properties-at-t/evaluate-2nd-derivative/double/evaluate-2nd-derivative-at-1.spec.ts: -------------------------------------------------------------------------------- 1 | // See 'evaluate-2nd-derivative.spec.ts' -------------------------------------------------------------------------------- /test/local-properties-at-t/evaluate-2nd-derivative/exact/evaluate-2nd-derivative-at-0-exact.spec.ts: -------------------------------------------------------------------------------- 1 | // See 'evaluate-2nd-derivative-exact.spec.ts' -------------------------------------------------------------------------------- /test/local-properties-at-t/evaluate-2nd-derivative/exact/evaluate-2nd-derivative-at-1-exact.spec.ts: -------------------------------------------------------------------------------- 1 | // See 'evaluate-2nd-derivative-exact.spec.ts' 2 | -------------------------------------------------------------------------------- /test/local-properties-at-t/evaluate/double/eval-de-casteljau.spec.ts: -------------------------------------------------------------------------------- 1 | // see 'evaluate.spec.ts' 2 | -------------------------------------------------------------------------------- /test/local-properties-at-t/tangent/double/tangent-at-0.spec.ts: -------------------------------------------------------------------------------- 1 | // See 'evaluate-2nd-derivative.spec.ts' -------------------------------------------------------------------------------- /test/local-properties-at-t/tangent/double/tangent-at-1.spec.ts: -------------------------------------------------------------------------------- 1 | // See 'evaluate-2nd-derivative.spec.ts' -------------------------------------------------------------------------------- /test/local-properties-at-t/tangent/double/tangent.spec.ts: -------------------------------------------------------------------------------- 1 | // See 'evaluate-2nd-derivative.spec.ts' -------------------------------------------------------------------------------- /test/local-properties-at-t/tangent/exact/tangent-at-0-exact.spec.ts: -------------------------------------------------------------------------------- 1 | // See 'evaluate-2nd-derivative-exact.spec.ts' -------------------------------------------------------------------------------- /test/local-properties-at-t/tangent/exact/tangent-at-1-exact.spec.ts: -------------------------------------------------------------------------------- 1 | // See 'evaluate-2nd-derivative-exact.spec.ts' -------------------------------------------------------------------------------- /test/local-properties-at-t/tangent/exact/tangent-exact.spec.ts: -------------------------------------------------------------------------------- 1 | // See 'evaluate-2nd-derivative-exact.spec.ts' 2 | -------------------------------------------------------------------------------- /test/transformation/degree-or-type/line-to-cubic.spec.ts: -------------------------------------------------------------------------------- 1 | // already tested in `to-cubic.spec.ts` -------------------------------------------------------------------------------- /test/transformation/degree-or-type/quadratic-to-cubic.spec.ts: -------------------------------------------------------------------------------- 1 | // already tested in `to-cubic.spec.ts` -------------------------------------------------------------------------------- /test/transformation/get-transformed-ts.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlorisSteenkamp/FloBezier/ab2def569c971a168257d9512d14030ebda53e49/test/transformation/get-transformed-ts.spec.ts -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "module": "es2022", 5 | "target": "es2022", 6 | "declaration": true, 7 | "noEmitOnError": true, 8 | "sourceMap": true, 9 | "outDir": "node", 10 | "moduleResolution": "node" 11 | }, 12 | "include": [ 13 | "src/index.ts" 14 | ], 15 | "exclude": [ 16 | "node_modules" 17 | ] 18 | } -------------------------------------------------------------------------------- /wallaby.mjs: -------------------------------------------------------------------------------- 1 | 2 | export default function(wallaby) { 3 | return { 4 | files: [ 5 | 'package.json', 6 | 'src/**/*.ts', 7 | 'test/helpers/*.ts', 8 | 'test/helpers/intersection/*.ts', 9 | 'test/helpers/intersection-fast/*.ts' 10 | ], 11 | tests: [ 12 | 'test/**/*.spec.ts' 13 | ], 14 | 15 | testFramework: 'mocha', 16 | 17 | compilers: { 18 | "**/*.+(t)s?": wallaby.compilers.typeScript() 19 | }, 20 | 21 | env: { 22 | type: 'node' 23 | }, 24 | 25 | setup: function () { 26 | // globalThis.expect = chai.expect; 27 | // var should = chai.should(); 28 | }, 29 | 30 | workers: { restart: true }, 31 | 32 | maxConsoleMessagesPerTest: 250 33 | }; 34 | }; 35 | --------------------------------------------------------------------------------