Bernstein basis polynomials: Difference between revisions
→{{header|ALGOL 68}}: Simplify a bit more
m (→{{header|ALGOL 68}}: Added note) |
(→{{header|ALGOL 68}}: Simplify a bit more) |
||
Line 435:
OP TOSTRING = ( BERNTHREE p )STRING:
"( " + f( b0 OF p ) + ", " + f( b1 OF p ) + ", " + f( b2 OF p ) + ", " + f( b3 OF p ) + " )";
# returns a string representation of the values of p #
OP TOSTRING = ( []REAL p )STRING:
STRING result := "(", separator := "";
result +:= separator + " " + f( p[ i ] );
result + " )"▼
BERNTWO p2 := BERNTWO ( "p", 0, 0, 0 );
Line 450 ⟶ 460:
tobern2( q0m, q1m, q2m, q2 );
print( ( "Subprogram (1) examples:", newline ) );
print( ( " mono
print( ( " mono ", TOSTRING []REAL( q0m,
▲ )
print( ( " mono ( ", f( q0m ), ", ", f( q1m ), ", ", f( q2m )▼
▲ , " ) --> bern ", TOSTRING q2, newline
▲ )
print( ( "Subprogram (2) examples:", newline ) );
Line 469 ⟶ 473:
tobern3( r0m, r1m, r2m, r3m, r3 );
print( ( "Subprogram (3) examples:", newline ) );
print( ( " mono
print( ( " mono ", TOSTRING []REAL( q0m,
▲ print( ( " mono
▲ )
▲ )
▲ )
print( ( "Subprogram (4) examples:", newline ) );
|