Esempio n. 1
0
 /// <summary>
 /// verify is this cs is equals to otherByLayer ( same origin, x, y, z base vectors )
 /// </summary>
 /// <param name="tol">calc tolerance ( for origin check )</param>
 /// <param name="other">cs to check equality against</param>
 /// <returns>true if this cs equals the given on, false otherwise</returns>
 /// <remarks>
 /// [unit test](/test/Vector3D/Vector3DTest_0001.cs)
 /// </remarks>
 public bool Equals(double tol, CoordinateSystem3D other)
 {
     return(Origin.EqualsTol(tol, other.Origin) &&
            BaseX.EqualsTol(tol, other.BaseX) &&
            BaseY.EqualsTol(tol, other.BaseY) &&
            BaseZ.EqualsTol(tol, other.BaseZ));
 }
Esempio n. 2
0
 /// <summary>
 /// Overrides GetHashCode.
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     return(BaseO.GetHashCode() +
            BaseX.GetHashCode() +
            BaseY.GetHashCode() +
            BaseZ.GetHashCode());
 }
Esempio n. 3
0
 /// <summary>
 /// return another cs with same origin and base vector rotated about given vector
 /// </summary>
 public CoordinateSystem3D Rotate(Vector3D vectorAxis, double angleRad)
 {
     return(new CoordinateSystem3D(
                Origin,
                BaseX.RotateAboutAxis(vectorAxis, angleRad),
                BaseY.RotateAboutAxis(vectorAxis, angleRad),
                BaseZ.RotateAboutAxis(vectorAxis, angleRad)));
 }
Esempio n. 4
0
 /// <summary>
 /// Overrides the Equals-method. Two bases are equal, if the parameter BaseO, BaseX,BaseY and BaseZ are equals
 /// in the sense of <see cref="xyz.Equals"/>.
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public override bool Equals(object obj)
 {
     if (obj is Base)
     {
         Base Other = (Base)obj;
         return(BaseO.Equals(Other.BaseO) &&
                BaseX.Equals(Other.BaseX) &&
                BaseY.Equals(Other.BaseY) &&
                BaseZ.Equals(Other.BaseZ));
     }
     else
     if (obj is String)
     {
         return(true);
     }
     return(base.Equals(obj));
 }
  public static void Main() {
    new Derived1().targetLanguageBaseMethod();
    new Derived2().targetLanguageBaseMethod();

    new MultipleDerived1().targetLanguageBaseMethod();
    new MultipleDerived2().targetLanguageBaseMethod();
    new MultipleDerived3().f();
    new MultipleDerived4().g();

    BaseX baseX = new BaseX();
    baseX.basex();
    baseX.targetLanguageBase2Method();

    DerivedX derivedX = new DerivedX();
    derivedX.basex();
    derivedX.derivedx();
    derivedX.targetLanguageBase2Method();
  }
    public static void Main()
    {
        new Derived1().targetLanguageBaseMethod();
        new Derived2().targetLanguageBaseMethod();

        new MultipleDerived1().targetLanguageBaseMethod();
        new MultipleDerived2().targetLanguageBaseMethod();
        new MultipleDerived3().f();
        new MultipleDerived4().g();

        BaseX baseX = new BaseX();

        baseX.basex();
        baseX.targetLanguageBase2Method();

        DerivedX derivedX = new DerivedX();

        derivedX.basex();
        derivedX.derivedx();
        derivedX.targetLanguageBase2Method();
    }
Esempio n. 7
0
 {   /// <summary>
     /// Calculates a string belonging to the Base.e.g. to the unit base you get 0/0/0; 1/0/0; 0/1/0/;0/0/1
     /// </summary>
     /// <returns>string belonging to the Base</returns>
     public override string ToString()
     {
         return("[" + BaseO.ToString() + ";" + BaseX.ToString() + ";" + BaseY.ToString() + ";" + BaseZ.ToString() + "]");
     }