public int LexicalCompare(Ray2d other) { var cmp = Origin.LexicalCompare(other.Origin); if (cmp != 0) { return(cmp); } return(Direction.LexicalCompare(other.Direction)); }