The line plot displays deviations from a straight line in both positive and negative direction. The line plot data can also be displayed as roughness plot.
Line points consist of…
The positions don’t have to be equidistant like in the example.
The plot axis can be modified with the actual geometry parameters Length
and Position
. The Length
parameter will be multiplied to the points position range to determine the value range of the plot, while the Position
parameter is added as an offset. The plots ProjectionAxis
determines, which coordinate of the Position
is used as offset.
var plot = new StraightnessPlot();
var segment = new Segment<LinePoint, LineGeometry>( "All", SegmentTypes.None );
plot.Segments.Add( segment );
var rand = new Random( DateTime.Now.Millisecond );
plot.Actual.Length = 5.0; //All positions will be multiplied with the length when the plot is drawn.
//The actual position and length, together with the projection axis, will result in an offset on the plots x-axis.
//In this example, the plot's value will start at 8.0;
plot.Actual.Position = new Vector( 0, 8 );
plot.ProjectionAxis = ProjectionAxis.Y;
for( var i = 0; i < pointCount; i++ )
{
var position = ( double ) i / pointCount;
var deviation = 0.1 * ( Math.Sin( position * 2.0 * Math.PI ) + ( rand.NextDouble() - 0.5 ) * 0.1 );
var point = new LinePoint( position, deviation );
segment.Points.Add( point );
}
plot.Tolerance = new Tolerance( -0.1, 0.1 );
plot.DefaultErrorScaling = 100;