/// <summary> /// Returns whether or not the two lines are perpendicular to each other /// </summary> /// <param name="passedLine"></param> /// <returns></returns> public static bool IsPerpendicularTo([NotNull] this ILinear thisLine, [NotNull] ILinear otherLine) { return(thisLine.SmallestAngleBetween(otherLine) == Unit.RightAngle); }
// public /// <summary> /// Determines whether or not the two lines are perpindicular to each other, up to a given tolerance. /// </summary> /// <returns></returns> public static bool IsPerpendicularTo(ILinear thisLine, ILinear otherLine, Angle tolerance) { var angle = thisLine.SmallestAngleBetween(otherLine); return(angle.EqualsWithinTolerance(Unit.RightAngle, tolerance)); }
/// <summary> /// Determines if two lines are parallel up to a custom angular tolerance. /// That is, if the lines are within that angle of each other the lines are considered "parallel" /// </summary> public static bool IsParallelTo(this ILinear thisLine, ILinear otherLine, Angle tolerance) { var angle = thisLine.SmallestAngleBetween(otherLine); return(angle.EqualsWithinTolerance(Unit.ZeroAngle, tolerance)); }