public void ReturnsZeroOffset() { var subject = new PointProfile(); Vector2 offset, heading; subject.GetOffsetAndHeading(out offset, out heading); Assert.AreEqual(0f, offset.X); Assert.AreEqual(0f, offset.Y); }
public void ReturnsHeadingAsUnitVector() { var subject = new PointProfile(); Vector2 offset, heading; subject.GetOffsetAndHeading(out offset, out heading); var length = Math.Sqrt(heading.X * heading.X + heading.Y * heading.Y); Assert.AreEqual(1f, length, 0.000001); }
private Profile ParseProbeData(IList <string> lines) { PointProfile pp = new PointProfile(); double X, Y; X = Y = 0; foreach (string l in lines) { if (l != string.Empty) { string[] vs = l.Split(new char[] { ',' }); X = double.Parse(vs[0]); Y = double.Parse(vs[1]); pp.Add(X, Y); } } return(pp); }
private Profile ParseProbeData(IList<string> lines) { PointProfile pp = new PointProfile(); double X, Y; X = Y = 0; foreach (string l in lines) { if (l != string.Empty) { string[] vs = l.Split(new char[] { ',' }); X = double.Parse(vs[0]); Y = double.Parse(vs[1]); pp.Add(X, Y); } } return pp; }