public static txVector2 Domain0(double r, double theta, txMatrix2 m) { txVector2 rtn; rtn.x = 2.0 * r * Math.Cos(theta) - r * Math.Cos(2.0 * theta); rtn.y = 2.0 * r * Math.Sin(theta) - r * Math.Sin(2.0 * theta); rtn = m * rtn; return rtn; }
public void Domain0Test() { double r = 10F; // TODO: Initialize to an appropriate value double theta = 0F; // TODO: Initialize to an appropriate value txMatrix2 m = new txMatrix2(); // TODO: Initialize to an appropriate value m = txMatrix2.Identity(); txVector2 expected = new txVector2(); // TODO: Initialize to an appropriate value expected.x = r; expected.y = 0; txVector2 actual; actual = txScrwUtility.Domain0(r, theta, m); Assert.AreEqual(expected, actual); //Assert.Inconclusive("Verify the correctness of this test method."); }
void NeggativeY() { txMatrix2 m = new txMatrix2(Math.PI); foreach (txVector2 item in positivey) { neggativey.Add(m * item); } FileStream fs = new FileStream(fileneggative, FileMode.Create); StreamWriter sw = new StreamWriter(fs); foreach (txVector2 item in neggativey) { sw.WriteLine(item.x+"\t\t\t"+item.y); } sw.Flush(); sw.Close(); sw.Dispose(); }
void PrintDomain2() { FileStream fs = new FileStream(file2, FileMode.OpenOrCreate); StreamWriter sw = new StreamWriter(fs); int n = 100; double t = -screwutility.Alphact; double tend = 0; double step = (tend - t) / n; txVector2 currentv; txMatrix2 m = new txMatrix2(2.0 * screwutility.Alpha); for (int i = 0; i < n; i++) { currentv = txScrwUtility.Domain0(screwutility.ScrewRadius, t, m); //sw.Write(currentv.x + "\t\t\t\t\t\t" + currentv.y); sw.WriteLine(currentv.x + "\t\t\t" + currentv.y); positivey.Add(currentv); t += step; } sw.Flush(); sw.Close(); sw.Dispose(); }