Skip to content

Commit fbfbac2

Browse files
authored
Wrap lines, rearrange docs.
1 parent a38d00f commit fbfbac2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/types.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,12 @@ where
254254
self.x() * point.x() + self.y() * point.y()
255255
}
256256

257-
/// Returns the cross product of 3 points
257+
/// Returns the cross product of 3 points. A positive value implies
258+
/// `self` → `point_b` → `point_c` is counter-clockwise, negative implies
259+
/// clockwise.
260+
///
261+
/// # Examples
262+
///
258263
/// ```
259264
/// use geo::Point;
260265
///
@@ -266,12 +271,12 @@ where
266271
///
267272
/// assert_eq!(cross, 2.0)
268273
/// ```
269-
/// A positive value implies self → point_b → point_c is counter-clockwise, negative implies clockwise.
270274
pub fn cross_prod(&self, point_b: &Point<T>, point_c: &Point<T>) -> T
271275
where
272276
T: Float,
273277
{
274-
(point_b.x() - self.x()) * (point_c.y() - self.y()) - (point_b.y() - self.y()) * (point_c.x() - self.x())
278+
(point_b.x() - self.x()) * (point_c.y() - self.y()) -
279+
(point_b.y() - self.y()) * (point_c.x() - self.x())
275280
}
276281

277282
/// Convert this `Point` into a tuple of its `x` and `y` coordinates.

0 commit comments

Comments
 (0)