From c3cfb0bf5ce638769e64a7760c84f1741165b61d Mon Sep 17 00:00:00 2001 From: gnxlxnxx Date: Tue, 23 Jun 2020 20:28:31 +0200 Subject: [PATCH] Update the docs --- src/lib.rs | 66 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 432b0d1..fc658bb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,18 +1,70 @@ -//! Call all functions with a Vector as argument the vector should contain: -//! - the end point as origin -//! - the end angle as angle in degrees in clockwise direction (eg. 0° facing north, 90° (π/2) facing east, ...) -//! - the circle radius as magnitude +//! This Crate calculates Dubins Paths +//! +//! +//! eg rsr path: +//! +//! ----- +//! /- \ +//! /-/ \ +//! /-- / \ +//! /- | | +//! /-- | | +//! /- | | +//! /-- \ / +//! /- \ X goal +//! /-- \ / +//! /- ----- +//! /-- +//! /- +//! ----- +//! / \ +//! / \ +//! / \ +//! | | +//! start X | +//! | | +//! \ / +//! \ / +//! \ / +//! ----- +//! +//! +//! The start point is (0,0) facing in positive y-direction +//! +//! The arguments to get a path are +//! +//! - radius: the minimum radius you can drive or respectively the radius you want to drive (f64) +//! - end_point: the point you want to end up (Point) +//! - end_angle: the angle you want to have in the end (Angle) +//! +//! The paths can be categorized into two subsections: +//! +//! - The circle straight circle (CSC) paths: +//! +//! - right straight right (rsr) paths +//! - right straight left (rsl) paths +//! - left straight right (lsr) paths +//! - left straight left (lsl) paths +//! +//! note: rsr and lsl paths can be constructed on every point on the plane, +//! rsl and lsr might return an error if the circles overlap each other, +//! because then the path cannot be constructed +//! +//! - The circle circle circle (CCC) paths: +//! +//! - right left right (rlr) paths +//! - left right left (lrl) paths +//! +//! note: both paths can return an error if the points are too far apart //! -//! Start Vector is in the origin facing in positive y-direction //! -//! Every struct defined here is 2 dimensional and uses f64 use euclid::{approxeq::ApproxEq, Point2D, Rotation2D, UnknownUnit}; use thiserror::Error; pub type Angle = euclid::Angle; pub type Point = Point2D; -type Vector2D = euclid::Vector2D; +pub type Vector = euclid::Vector2D; type Rotation = Rotation2D; #[derive(Debug, Error)]