示例#1
0
 public static Point <T> operator +(Point <T> a, Point <T> b)
 {
     return(new Point <T>(
                GenericArithmetic <T> .add(a.x, b.x),
                GenericArithmetic <T> .add(a.y, b.y)
                ));
 }
示例#2
0
 public T dot(Point <T> other)
 {
     return(GenericArithmetic <T> .add(
                GenericArithmetic <T> .multiply(x, other.x),
                GenericArithmetic <T> .multiply(y, other.y)
                ));
 }