MCPcopy Create free account
hub / github.com/algorithm-archivists/algorithm-archive / cmp

Method cmp

contents/graham_scan/code/rust/graham_scan.rs:23–26  ·  view source on GitHub ↗
(&self, other: &Self)

Source from the content-addressed store, hash-verified

21// Defines an order for Points so they can be sorted
22impl Ord for Point {
23 fn cmp(&self, other: &Self) -> Ordering {
24 // Neither field of Point will be NaN, so this is safe
25 self.partial_cmp(other).unwrap()
26 }
27}
28
29// Determines whether the angle abc is clockwise, counter-clockwise or colinear

Callers

nothing calls this directly

Calls 1

partial_cmpMethod · 0.45

Tested by

no test coverage detected