!****h* Main/PInit ! NAME ! PInit -- Initializes the P-Values vector for use in CubicCrv() ! [PInit.MBS] ! ! DESCRIPTION ! Module steps: ! * Initialize unset points on 'P' value unit vector to zero. ! * Generate a 2-segment spline curve with 3 points with its ! length equal to NoPts. ! * Put interpolated points back in 'PValues' array for return. ! ! SOURCE GLOBAL GEOMETRY MODULE PInit( INT NoPts; ! Number of points FLOAT First, ! Begining Point Middle, ! Mid Point Last; ! Last Point VAR FLOAT PValues(13)); ! 'P' value array !*** ! ! Copyright 2006, John J. Hughes ! ! This source code file is part of the 'NGBproject' files which ! execute interactively under the 'VARKON' program, which is ! distributed under the terms of the GNU General Public License. ! ! The 'NGBproject' files are also distributed under the terms of ! the GNU GeneralPublic License. See the GNU General Public License n ! included ithe file name "COPYING.txt" in the Varkon ./app/NGB/doc ! directory for more details. ! INT i; VECTOR tmp; BEGINMODULE ! ~ Initialize unset points on 'P' value unit vector FOR i:=1 TO 13 DO PValues(i):=0.0; ENDFOR; ! ~ Generate a 2-segment spline curve with 3 points of length NoPts cur_spline(#10,"FERGUSON",vec(0,First),,vec(NoPts/2,Middle) ,,vec(NoPts,Last):BLANK=1); ! ~ Put interpolated points back in 'PValues' array for return FOR i:=0 TO (NoPts-1) DO tmp:=on(#10, 2*i/(NoPts-1)); PValues(i+1):=tmp.y; ENDFOR; ENDMODULE