Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C# by Sascha ( 15 years ago )
public class ZweiK
{
public double x = 2.9;
public double y = 2.8;
public ZweiK() : this(0, 0) { }
public ZweiK(double px, double py)
{
x = px;
y = py;
}
}
public class Vektor2D : ZweiK
{
public Vektor2D(double x, double y) : base(x, y) { }
public static Vektor2D operator +(Vektor2D v1, Vektor2D v2)
{
return new Vektor2D(v1.x + v2.y, v1.y + v2.y);
}
public static Vektor2D operator -(Vektor2D v1, Vektor2D v2)
{
return new Vektor2D(v1.x - v2.x, v1.y - v2.y);
}
public static Vektor2D operator +(Vektor2D v)
{
return new Vektor2D(v.x, v.y);
}
public static Vektor2D operator -(Vektor2D v)
{
return new Vektor2D(-v.x, -v.y);
}
}
Revise this Paste