Last updated: March 2008. Kajiyama             [ 目次に戻る ]

#macroを使った数式表現 -平面と曲面-


サンプルform-3d-11.pov

//form-3d-11.pov
//  POV-Ray  3.6  scene  file  by  Kajiyama

#include  "colors.inc"
#include  "shapes.inc"

//カメラ設定
camera{
 orthographic
 angle  40
location  <  20,20,-20>
 look_at  <0,3,0>
}

//ライト設定
light_source{
 <15,25,-8>  color  White*1.7
}

//  座標系の表示
//  Z軸
cylinder{<0,0,-10>,<0,0,17>,0.05
             pigment{color  Red}
             finish{phong  1  reflection  0.1}
}
cone{<0,0,17>,0.3
         <0,0,18.5>,0
             pigment{color  Red}
}
//  Z文字
cylinder{<-0.5,0.5,0>,<0.5,0.5,0>,0.08
             pigment{color  Red}
             finish{phong  1  reflection  0.1}        
             translate  <0,1.1,19>
}
cylinder{<0.5,0.5,0>,<-0.5,-0.5,0>,0.08
               pigment{color  Red}
               finish{phong  1  reflection  0.1}      
               translate  <0,1.1,19>
}
cylinder{  <-0.5,-0.5,0>,  <0.5,-0.5,0>,0.08
               pigment{color  Red}
               finish{phong  1  reflection  0.1}
               translate  <0,1.1,19>
}
//  X軸
cylinder{<-15,0,0>,<7,0,0>,0.05
               pigment{color  Green}
               finish{phong  1  reflection  0.1}
}
cone{<7,0,0>,0.3
         <8.5,0,0>,0
             pigment{color  Green}
}
//  X文字
cylinder{<-0.5,-0.5,0>,<0.5,0.5,0>,0.08
             pigment{color  Green}
               finish{phong  1  reflection  0.1}
               rotate  y*90        
               translate  <9,1.1,0>
}
cylinder{  <-0.5,0.5,0>,  <0.5,-0.5,0>,0.08
               pigment{color  Green}
               finish{phong  1  reflection  0.1}
               rotate  y*90
               translate  <9,1.1,0>
}

//  Y軸
cylinder{<0,-15,0>,<0,7,0>,0.05
             pigment{color  Blue}
             finish{phong  1  reflection  0.1}
}
cone{<0,7,0>,0.3
         <0,8.5,0>,0
             pigment{color  Blue}
}
//  Y文字
cylinder{<-0.5,0.5,0>,<0,0,0>,0.08
               pigment{color  Blue}
               finish{phong  1  reflection  0.1}              
               translate  <0,9,0>
}
cylinder{<0.5,0.5,0>,<0,0,0>,0.08
               finish{phong  1  reflection  0.1}              
               translate  <0,9,0>
}
cylinder{  <0,0,0>,  <0,-0.5,0>,0.08
               pigment{color  Blue}
               finish{phong  1  reflection  0.1}
               translate  <0,9,0>
}


//■#macro  グラフ式を記述する
//y=-x
#macro  f(x1,z1)    
-pow(x1,1)
#end

//■グラフ表示ルーチン
#declare  x_max=1;
#declare  z_max=1;
#declare  d=0.01;

#declare  x1=-x_max;
 #while  (x1<=x_max)
     #declare  z1=-z_max;
             #while  (z1<=z_max)

object{
         sphere{<x1,f(x1,z1)  ,z1>,d}
         scale  6
         pigment{checker    color  Red  color  White*0.9}
         no_shadow
}

             #declare  z1=z1+d;
           #end
       #declare  x1=x1+d;
 #end


//■立体文字(数式)表示
text  {
ttf  "timrom.ttf"  
       "y=-x"  0.05,0
       pigment  {color  Blue  }
       scale  2
       rotate  y*-40        
       translate  <-9,8,-6>
       }

background{color  White}

サンプル form-3d-12.pov

//form-3d-12.pov
//  POV-Ray  3.6  scene  file  by  Kajiyama

#include  "colors.inc"
#include  "shapes.inc"

//カメラ設定
camera{
 orthographic
 angle  40
location  <  20,20,-20>
 look_at  <0,-3,0>
}

//ライト設定
light_source{
 <15,25,-8>  color  White*1.7
}

//  座標系の表示
//  Z軸
cylinder{<0,0,-10>,<0,0,17>,0.05
             pigment{color  Red}
             finish{phong  1  reflection  0.1}
}
cone{<0,0,17>,0.3
         <0,0,18.5>,0
             pigment{color  Red}
}
//  Z文字
cylinder{<-0.5,0.5,0>,<0.5,0.5,0>,0.08
             pigment{color  Red}
             finish{phong  1  reflection  0.1}        
             translate  <0,1.1,19>
}
cylinder{<0.5,0.5,0>,<-0.5,-0.5,0>,0.08
               pigment{color  Red}
               finish{phong  1  reflection  0.1}      
               translate  <0,1.1,19>
}
cylinder{  <-0.5,-0.5,0>,  <0.5,-0.5,0>,0.08
               pigment{color  Red}
               finish{phong  1  reflection  0.1}
               translate  <0,1.1,19>
}
//  X軸
cylinder{<-15,0,0>,<7,0,0>,0.05
               pigment{color  Green}
               finish{phong  1  reflection  0.1}
}
cone{<7,0,0>,0.3
         <8.5,0,0>,0
             pigment{color  Green}
}
//  X文字
cylinder{<-0.5,-0.5,0>,<0.5,0.5,0>,0.08
             pigment{color  Green}
               finish{phong  1  reflection  0.1}
               rotate  y*90        
               translate  <9,1.1,0>
}
cylinder{  <-0.5,0.5,0>,  <0.5,-0.5,0>,0.08
               pigment{color  Green}
               finish{phong  1  reflection  0.1}
               rotate  y*90
               translate  <9,1.1,0>
}

//  Y軸
cylinder{<0,-15,0>,<0,7,0>,0.05
             pigment{color  Blue}
             finish{phong  1  reflection  0.1}
}
cone{<0,7,0>,0.3
         <0,8.5,0>,0
             pigment{color  Blue}
}
//  Y文字
cylinder{<-0.5,0.5,0>,<0,0,0>,0.08
               pigment{color  Blue}
               finish{phong  1  reflection  0.1}              
               translate  <0,9,0>
}
cylinder{<0.5,0.5,0>,<0,0,0>,0.08
               finish{phong  1  reflection  0.1}              
               translate  <0,9,0>
}
cylinder{  <0,0,0>,  <0,-0.5,0>,0.08
               pigment{color  Blue}
               finish{phong  1  reflection  0.1}
               translate  <0,9,0>
}


//■#macro  グラフ式を記述する
//y=-x^2
#macro  f(x1,z1)    
-pow(x1,2)
#end

//■グラフ表示ルーチン
#declare  x_max=1;
#declare  z_max=1;
#declare  d=0.01;

#declare  x1=-x_max;
 #while  (x1<=x_max)
     #declare  z1=-z_max;
             #while  (z1<=z_max)

object{
         sphere{<x1,f(x1,z1)  ,z1>,d}
         scale  6
         pigment{checker    color  Red  color  White*0.9}
         no_shadow
}

             #declare  z1=z1+d;
           #end
       #declare  x1=x1+d;
 #end


//■立体文字(数式)表示
text  {
ttf  "timrom.ttf"  
       "y=-x*x"  0.05,0
       pigment  {color  Blue  }
       scale  2
       rotate  y*-40        
       translate  <-9,6,-6>
       }

background{color  White}

サンプル form-3d-13.pov

//form-3d-13.pov
//  POV-Ray  3.6  scene  file  by  Kajiyama

#include  "colors.inc"
#include  "shapes.inc"

//カメラ設定
camera{
 orthographic
 angle  40
location  <  20,20,-20>
 look_at  <0,3,0>
}

//ライト設定
light_source{
 <15,25,-8>  color  White*1.7
}

//  座標系の表示
//  Z軸
cylinder{<0,0,-10>,<0,0,17>,0.05
             pigment{color  Red}
             finish{phong  1  reflection  0.1}
}
cone{<0,0,17>,0.3
         <0,0,18.5>,0
             pigment{color  Red}
}
//  Z文字
cylinder{<-0.5,0.5,0>,<0.5,0.5,0>,0.08
             pigment{color  Red}
             finish{phong  1  reflection  0.1}        
             translate  <0,1.1,19>
}
cylinder{<0.5,0.5,0>,<-0.5,-0.5,0>,0.08
               pigment{color  Red}
               finish{phong  1  reflection  0.1}      
               translate  <0,1.1,19>
}
cylinder{  <-0.5,-0.5,0>,  <0.5,-0.5,0>,0.08
               pigment{color  Red}
               finish{phong  1  reflection  0.1}
               translate  <0,1.1,19>
}
//  X軸
cylinder{<-15,0,0>,<7,0,0>,0.05
               pigment{color  Green}
               finish{phong  1  reflection  0.1}
}
cone{<7,0,0>,0.3
         <8.5,0,0>,0
             pigment{color  Green}
}
//  X文字
cylinder{<-0.5,-0.5,0>,<0.5,0.5,0>,0.08
             pigment{color  Green}
               finish{phong  1  reflection  0.1}
               rotate  y*90        
               translate  <9,1.1,0>
}
cylinder{  <-0.5,0.5,0>,  <0.5,-0.5,0>,0.08
               pigment{color  Green}
               finish{phong  1  reflection  0.1}
               rotate  y*90
               translate  <9,1.1,0>
}

//  Y軸
cylinder{<0,-15,0>,<0,7,0>,0.05
             pigment{color  Blue}
             finish{phong  1  reflection  0.1}
}
cone{<0,7,0>,0.3
         <0,8.5,0>,0
             pigment{color  Blue}
}
//  Y文字
cylinder{<-0.5,0.5,0>,<0,0,0>,0.08
               pigment{color  Blue}
               finish{phong  1  reflection  0.1}              
               translate  <0,9,0>
}
cylinder{<0.5,0.5,0>,<0,0,0>,0.08
               finish{phong  1  reflection  0.1}              
               translate  <0,9,0>
}
cylinder{  <0,0,0>,  <0,-0.5,0>,0.08
               pigment{color  Blue}
               finish{phong  1  reflection  0.1}
               translate  <0,9,0>
}


//■#macro  グラフ式を記述する
//y=-x^3
#macro  f(x1,z1)    
-pow(x1,3)
#end

//■グラフ表示ルーチン
#declare  x_max=1;
#declare  z_max=1;
#declare  d=0.01;

#declare  x1=-x_max;
 #while  (x1<=x_max)
     #declare  z1=-z_max;
             #while  (z1<=z_max)

object{
         sphere{<x1,f(x1,z1)  ,z1>,d}
         scale  6
         pigment{checker    color  Red  color  White*0.9}
         no_shadow
}

             #declare  z1=z1+d;
           #end
       #declare  x1=x1+d;
 #end


//■立体文字(数式)表示
text  {
ttf  "timrom.ttf"  
       "y=-x*x*x"  0.05,0
       pigment  {color  Blue  }
       scale  2
       rotate  y*-40        
       translate  <-9,9,-6>
       }

background{color  White}

[ 目次に戻る ]