コード例 #1
0
 public Pair ScalarMultiply(Pair p, int scalar)
 {
     return new Pair { First = p.First * scalar, Second = p.Second * scalar };
 }
コード例 #2
0
 public Pair Subtract(Pair p1, Pair p2)
 {
     return new Pair { First = p1.First - p2.First, Second = p1.Second - p2.Second };
 }
コード例 #3
0
 public Pair Add(Pair p1, Pair p2)
 {
     return new Pair { First = p1.First + p2.First, Second = p1.Second + p2.Second };
 }