Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2014-06-07 17:29:58

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,402
Website

Post Beautiful Plots

Attach their codes, too.

sagelogo.png Code:

def f(z):

    x = real(z)

    y = imaginary(z)

    return (x^2 + y^2 -1)^3 - x^2*y^3

complex_plot(lambda z: (1/f(z)*i^(z+1)),(-1.5,1.5),(-1.5,1.5),plot_points=300)

(The code takes a lot of time to run, for testing purposes run with plot_points=50)

kAizzX7.png

Last edited by Agnishom (2014-06-07 17:33:31)


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Online

#2 2014-06-07 18:12:50

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,402
Website

Re: Post Beautiful Plots

I've lost the exact code for this but it is somewhat like this:

POV-Ray Code:

	

    #declare e = 2.71828;
    #include "textures.inc"
    #include "colors.inc"
    #include "glass.inc"
    camera {
    location <0, 0, -10>
    look_at <0,0,0>
    }
    light_source
    {
    <0,0,-10>
    color rgb <1.0, 1.0, 1.0>
    shadowless
    spotlight
    rotate y*clock*-100
    }
    #declare Ball =
      sphere{<0,0,0>,0.08
        texture{
          pigment{color rgb<1,0.8,0>}
          finish {diffuse 0.9 phong 1}
        }// end of texture
      }// end of sphere
     
    //------------------------------------
    #declare X = -5;    // start value X
    #declare EndX = 5;  //   end value X
    #declare Step = 0.001;// step value
    #declare Sine =
    union{
    #while ( X < EndX + Step)//loop start
      object{ Ball translate <X,sin(X),0>}
     
    #declare X = X + Step; // next X
    #end // ------------------- loop end
    };
    #declare X = -5;    // start value X
    #declare EndX = 5;  //   end value X
    #declare Step = 0.001;// step value
    #declare Curvedd =
    union{
    #while ( X < EndX + Step)//loop start
      object{ Ball pigment {color rgb<0,0,1>} translate <X,cos(X)+cos(pow(X,2)),0>}
     
    #declare X = X + Step; // next X
    #end // ------------------- loop end
    };
     
    #declare X = 0;    // start value X
    #declare EndX = 6.28;  //   end value X
    #declare Step = 0.001;// step value
    #declare Cardioid =
    union{
    #while ( X < EndX + Step)//loop start
      #declare r = 1 - sin(X);
      object{ Ball pigment {color rgb<0,1,0>} translate <r*cos(X),r*sin(X),0>}
     
    #declare X = X + Step; // next X
    #end}; // ------------------- loop end  
     
    #declare X = 0;    // start value X
    #declare EndX = 6.28;  //   end value X
    #declare Step = 0.001;// step value
    #declare Butterfly =
    union{
    #while ( X < EndX + Step)//loop start
      #declare r = pow(e,sin(X)) - 2*cos(4*X) + pow(sin((2*X-pi)/24),5);
      object{ Ball texture{Polished_Brass} translate <r*cos(X),r*sin(X),0>}
     
    #declare X = X + Step; // next X
    #end}; // ------------------- loop end
     
    #declare X = -6.28;    // start value X
    #declare EndX = 6.28*2
    ;  //   end value X
    #declare Step = 0.001;// step value
    #declare log_spiral =
    union{
    #while ( X < EndX + Step)//loop start
      #declare b = log(1.61803397)/(3.14159/2);
      #declare r = 1*pow(e,b*X);
      object{ Ball texture{Gold_Metal} translate <r*cos(X),r*sin(X),0>}
     
    #declare X = X + Step; // next X
    #end}; // ------------------- loop end
     
     
    #declare X = -6.28;    // start value X
    #declare EndX = 6.28
    ;  //   end value X
    #declare Step = 0.001;// step value
    #declare Fermat_spiral =
    union{
    #while ( X < EndX + Step)//loop start
      #declare r = pow(X,0.5);
      object{ Ball texture{Polished_Brass} translate <r*cos(X),r*sin(X),0>}
      #declare r = -1*pow(X,0.5);
      object{ Ball texture{Polished_Brass} translate <r*cos(X),r*sin(X),0>}
    #declare X = X + Step; // next X
    #end}; // ------------------- loop end
     
    object {Butterfly texture{Jade}}
    /*object {Cardioid}
    object {Sine}
    object {Curvedd}
    object {Fermat_spiral} 
    object {log_spiral}*/
     
     
    sphere{ <0,0,0>, 1
            texture{T_Glass3
                   } // end of texture
            interior
            {I_Glass_Fade_Sqr1}
            finish
            {F_Glass1}
            scale 100
          }

Uncomment any of the lines in this portion of the code above as you wish:

object {Butterfly texture{Jade}}
    /*object {Cardioid}
    object {Sine}
    object {Curvedd}
    object {Fermat_spiral} 
    object {log_spiral}*/

395051_298470096924598_1860853671_n.jpg
529427_342652385839702_559753891_n.jpg


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Online

#3 2014-06-07 18:23:48

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,402
Website

Re: Post Beautiful Plots

Mathematica Code:

ContourPlot[
 Evaluate[Re[
   Product[x + I y - (a + I b), {a, -2, 2}, {b, -2, 2}]]], {x, -3, 
  3}, {y, -3, 3}]

O_139.gif


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Online

Board footer

Powered by FluxBB