## [Apophysis-cvs-commits] 2.10/Source varSuperShape.pas,1.1,1.2

 [Apophysis-cvs-commits] 2.10/Source varSuperShape.pas,1.1,1.2 From: Piotr Borys - 2007-06-23 19:34:56 ```Update of /cvsroot/apophysis/2.10/Source In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv13880 Modified Files: varSuperShape.pas Log Message: Final super_shape variation. Index: varSuperShape.pas =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/varSuperShape.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** varSuperShape.pas 17 Jun 2007 20:14:42 -0000 1.1 --- varSuperShape.pas 23 Jun 2007 19:34:52 -0000 1.2 *************** *** 29,33 **** TVariationSuperShape = class(TBaseVariation) private ! m, n, rnd, a, b, holes : double; public constructor Create; --- 29,33 ---- TVariationSuperShape = class(TBaseVariation) private ! m, n1, n2, n3, rnd, holes : double; public constructor Create; *************** *** 62,86 **** end; procedure TVariationSuperShape.CalcFunction; var ! r, theta, tmp : double; t1, t2 : double; dist: double; t1a, t2a: double; begin ! ! if n = 0 then r := 0 else begin ! theta := arctan2(FTy^, FTx^); SinCos((m*theta+pi)/4, t2, t1); - t1 := t1/a; t1 := abs(t1); ! t1 := power(t1, n); - t2 := t2/b; t2 := abs(t2); ! t2 := power(t2, n); if rnd < 1.0 then --- 62,91 ---- end; + function atan2(const y, x: double): double; + asm + FLD y + FLD x + FPATAN + end; + procedure TVariationSuperShape.CalcFunction; var ! r, theta : double; t1, t2 : double; dist: double; t1a, t2a: double; begin ! theta := 0; ! if n1 = 0 then r := 0 else begin ! theta := atan2(FTy^, FTx^); SinCos((m*theta+pi)/4, t2, t1); t1 := abs(t1); ! t1 := power(t1, n2); t2 := abs(t2); ! t2 := power(t2, n3); if rnd < 1.0 then *************** *** 89,93 **** dist := 0; ! r := (rnd*random + (1.0-rnd)*dist - holes) * power(t1+t2, -1/n); end; --- 94,98 ---- dist := 0; ! r := (rnd*random + (1.0-rnd)*dist - holes) * power(t1+t2, -1/n1); end; *************** *** 117,124 **** case Index Of 0: Result := 'super_shape_m'; ! 1: Result := 'super_shape_n'; ! 2: Result := 'super_shape_rnd'; ! 3: Result := 'super_shape_a'; ! 4: Result := 'super_shape_b'; 5: Result := 'super_shape_holes'; else --- 122,129 ---- case Index Of 0: Result := 'super_shape_m'; ! 1: Result := 'super_shape_n1'; ! 2: Result := 'super_shape_n2'; ! 3: Result := 'super_shape_n3'; ! 4: Result := 'super_shape_rnd'; 5: Result := 'super_shape_holes'; else *************** *** 140,145 **** m := Value; Result := True; ! end else if Name = 'super_shape_n' then begin ! n := Value; Result := True; end --- 145,158 ---- m := Value; Result := True; ! end else if Name = 'super_shape_n1' then begin ! n1 := Value; ! Result := True; ! end ! else if Name = 'super_shape_n2' then begin ! n2 := Value; ! Result := True; ! end ! else if Name = 'super_shape_n3' then begin ! n3 := Value; Result := True; end *************** *** 153,164 **** Result := True; end - else if Name = 'super_shape_a' then begin - a := Value; - Result := True; - end - else if Name = 'super_shape_b' then begin - b := Value; - Result := True; - end else if Name = 'super_shape_holes' then begin holes := Value; --- 166,169 ---- *************** *** 175,192 **** Value := m; Result := True; ! end else if Name = 'super_shape_n' then begin ! Value := n; Result := True; end ! else if Name = 'super_shape_rnd' then begin ! Value := rnd; Result := True; end ! else if Name = 'super_shape_a' then begin ! Value := a; Result := True; end ! else if Name = 'super_shape_b' then begin ! Value := b; Result := True; end --- 180,197 ---- Value := m; Result := True; ! end else if Name = 'super_shape_n1' then begin ! Value := n1; Result := True; end ! else if Name = 'super_shape_n2' then begin ! Value := n2; Result := True; end ! else if Name = 'super_shape_n3' then begin ! Value := n3; Result := True; end ! else if Name = 'super_shape_rnd' then begin ! Value := rnd; Result := True; end *************** *** 203,211 **** inherited Create; ! m := 4.0; ! n := 1.0; rnd := 0.0; - a := 1.0; - b := 1.0; holes := 1.0; end; --- 208,216 ---- inherited Create; ! m := 5.0; ! n1 := 2.0; ! n2 := 0.3; ! n3 := 0.3; rnd := 0.0; holes := 1.0; end; ```

 [Apophysis-cvs-commits] 2.10/Source varSuperShape.pas,1.1,1.2 From: Piotr Borys - 2007-06-23 19:34:56 ```Update of /cvsroot/apophysis/2.10/Source In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv13880 Modified Files: varSuperShape.pas Log Message: Final super_shape variation. Index: varSuperShape.pas =================================================================== RCS file: /cvsroot/apophysis/2.10/Source/varSuperShape.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** varSuperShape.pas 17 Jun 2007 20:14:42 -0000 1.1 --- varSuperShape.pas 23 Jun 2007 19:34:52 -0000 1.2 *************** *** 29,33 **** TVariationSuperShape = class(TBaseVariation) private ! m, n, rnd, a, b, holes : double; public constructor Create; --- 29,33 ---- TVariationSuperShape = class(TBaseVariation) private ! m, n1, n2, n3, rnd, holes : double; public constructor Create; *************** *** 62,86 **** end; procedure TVariationSuperShape.CalcFunction; var ! r, theta, tmp : double; t1, t2 : double; dist: double; t1a, t2a: double; begin ! ! if n = 0 then r := 0 else begin ! theta := arctan2(FTy^, FTx^); SinCos((m*theta+pi)/4, t2, t1); - t1 := t1/a; t1 := abs(t1); ! t1 := power(t1, n); - t2 := t2/b; t2 := abs(t2); ! t2 := power(t2, n); if rnd < 1.0 then --- 62,91 ---- end; + function atan2(const y, x: double): double; + asm + FLD y + FLD x + FPATAN + end; + procedure TVariationSuperShape.CalcFunction; var ! r, theta : double; t1, t2 : double; dist: double; t1a, t2a: double; begin ! theta := 0; ! if n1 = 0 then r := 0 else begin ! theta := atan2(FTy^, FTx^); SinCos((m*theta+pi)/4, t2, t1); t1 := abs(t1); ! t1 := power(t1, n2); t2 := abs(t2); ! t2 := power(t2, n3); if rnd < 1.0 then *************** *** 89,93 **** dist := 0; ! r := (rnd*random + (1.0-rnd)*dist - holes) * power(t1+t2, -1/n); end; --- 94,98 ---- dist := 0; ! r := (rnd*random + (1.0-rnd)*dist - holes) * power(t1+t2, -1/n1); end; *************** *** 117,124 **** case Index Of 0: Result := 'super_shape_m'; ! 1: Result := 'super_shape_n'; ! 2: Result := 'super_shape_rnd'; ! 3: Result := 'super_shape_a'; ! 4: Result := 'super_shape_b'; 5: Result := 'super_shape_holes'; else --- 122,129 ---- case Index Of 0: Result := 'super_shape_m'; ! 1: Result := 'super_shape_n1'; ! 2: Result := 'super_shape_n2'; ! 3: Result := 'super_shape_n3'; ! 4: Result := 'super_shape_rnd'; 5: Result := 'super_shape_holes'; else *************** *** 140,145 **** m := Value; Result := True; ! end else if Name = 'super_shape_n' then begin ! n := Value; Result := True; end --- 145,158 ---- m := Value; Result := True; ! end else if Name = 'super_shape_n1' then begin ! n1 := Value; ! Result := True; ! end ! else if Name = 'super_shape_n2' then begin ! n2 := Value; ! Result := True; ! end ! else if Name = 'super_shape_n3' then begin ! n3 := Value; Result := True; end *************** *** 153,164 **** Result := True; end - else if Name = 'super_shape_a' then begin - a := Value; - Result := True; - end - else if Name = 'super_shape_b' then begin - b := Value; - Result := True; - end else if Name = 'super_shape_holes' then begin holes := Value; --- 166,169 ---- *************** *** 175,192 **** Value := m; Result := True; ! end else if Name = 'super_shape_n' then begin ! Value := n; Result := True; end ! else if Name = 'super_shape_rnd' then begin ! Value := rnd; Result := True; end ! else if Name = 'super_shape_a' then begin ! Value := a; Result := True; end ! else if Name = 'super_shape_b' then begin ! Value := b; Result := True; end --- 180,197 ---- Value := m; Result := True; ! end else if Name = 'super_shape_n1' then begin ! Value := n1; Result := True; end ! else if Name = 'super_shape_n2' then begin ! Value := n2; Result := True; end ! else if Name = 'super_shape_n3' then begin ! Value := n3; Result := True; end ! else if Name = 'super_shape_rnd' then begin ! Value := rnd; Result := True; end *************** *** 203,211 **** inherited Create; ! m := 4.0; ! n := 1.0; rnd := 0.0; - a := 1.0; - b := 1.0; holes := 1.0; end; --- 208,216 ---- inherited Create; ! m := 5.0; ! n1 := 2.0; ! n2 := 0.3; ! n3 := 0.3; rnd := 0.0; holes := 1.0; end; ```