File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,12 @@ where
254
254
self . x ( ) * point. x ( ) + self . y ( ) * point. y ( )
255
255
}
256
256
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
+ ///
258
263
/// ```
259
264
/// use geo::Point;
260
265
///
@@ -266,12 +271,12 @@ where
266
271
///
267
272
/// assert_eq!(cross, 2.0)
268
273
/// ```
269
- /// A positive value implies self → point_b → point_c is counter-clockwise, negative implies clockwise.
270
274
pub fn cross_prod ( & self , point_b : & Point < T > , point_c : & Point < T > ) -> T
271
275
where
272
276
T : Float ,
273
277
{
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 ( ) )
275
280
}
276
281
277
282
/// Convert this `Point` into a tuple of its `x` and `y` coordinates.
You can’t perform that action at this time.
0 commit comments