# HG changeset patch # User Masataka Kohagura # Date 1408448489 -32400 # Node ID b798246629dde567c7757c143c841b9042d8befa # Parent 69de65730c71aedcc0d46d4f3f88d88e1c619ea6 fix Aug_19th diff -r 69de65730c71 -r b798246629dd Aug_19th.html --- a/Aug_19th.html Tue Aug 19 15:44:58 2014 +0900 +++ b/Aug_19th.html Tue Aug 19 20:41:29 2014 +0900 @@ -263,25 +263,35 @@ +
+

波形の生成

-
-

三角波、矩形波の生成

- -
    -
  • 矩形波
  • +

    矩形波

         
    -double square(double t){
    +double
    +square(double t){
         double decimal_part = t - abs(t);
         return decimal_part < 0.5 ? 1 : -1;
     }
         
    -
    + + + + +
+ -
  • 三角波
  • + +
    +

    波形の生成

    + +

    三角波

    +
         
    -double tri(double t){
    +double
    +tri(double t){
     
         double decimal_part = t - abs(t);
     
    @@ -291,9 +301,32 @@
             return decimal_part < 0.5 ? -decimal_part : 1 - decimal_part;
         }
     }
    +
         
    -    
    -
    + + + + +
    + + + +
    +

    波形の生成

    + +

    のこぎり波

    +
    +    
    +double
    +saw(double t)
    +{
    +    double decimal_part = t - abs(t);
    +    return decimal_part;
    +}
    +    
    +    
    + +