File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1133,20 +1133,20 @@ dessen Länge manipulieren.
11331133
11341134``` csharp
11351135// Es müssen beide Varianten implementiert werden!
1136- public static Point operator * (Point p1 , double ratio )
1136+ public static Vector operator * (Vector p1 , double ratio )
11371137{
1138- new Point (p1 .X * ratio , p1 .Y * ratio );
1138+ return new Vector (p1 .X * ratio , p1 .Y * ratio );
11391139}
11401140
1141- public static Point operator * (int ratio , Point p1 )
1141+ public static Vector operator * (int ratio , Vector p1 )
11421142{
1143- new Point (p1 .X * ratio , p1 .Y * ratio );
1143+ return new Vector (p1 .X * ratio , p1 .Y * ratio );
11441144}
11451145
11461146static void Main (string [] args )
11471147{
1148- Point ptOne = new Point (100 , 100 );
1149- Point ptTwo = new Point (40 , 40 );
1148+ Vector ptOne = new Vector (100 , 100 );
1149+ Vector ptTwo = new Vector (40 , 40 );
11501150}
11511151Console .WriteLine ((ptOne * 2 . 5 ));
11521152Console .WriteLine ((1 * ptOne ));
You can’t perform that action at this time.
0 commit comments