Giter Site home page Giter Site logo

3dgraph's Introduction

2変数関数の描画プログラム(3Dgraph)

image

環境

C言語+OpenGLの環境であれば動作する(はず). gcc用のMakefileを参考にコンパイルしてください.

使い方

次のようにコマンドライン引数を次のように実行する.

./3Dgraph.out func x_min x_max y_min y_max
./3Dgraph.out func x_min x_max x_num y_min y_max y_num

例)

./3Dgraph.out "sin(x) + pow((y + 1), 2)" -5 5 -2 2
./3Dgraph.out "sin(sqrt(x*x+y*y)) / sqrt(x*x+y*y)" -20 20 100 -20 20 100

四則演算(+,-,x,/)と括弧((,))が使える. また,次の関数が使える.自作の数式用eval関数を使っているためバグがある気がします. abs,fab,sqrt,sin,cos,tan,asin,acos,atan,sinh,cosh,tanh,asin,acosh,atanh,exp,log,log,ceil,floo,round,pow,atan2,hypot,mod,fmod

キー 動作
x x軸方向に大きくする
X x軸方向に小さくする
y y軸方向に大きくする
Y y軸方向に小さくする
z z軸方向に大きくする
Z Z軸方向に小さくする
u グラフの拡大
U グラフの縮小
w ワイヤフレームの表示・非表示
s サーフェイスモデルの表示・非表示
t 目盛りの表示・非表示
S 画像の保存
Esc プログラムの終了

マウスの左ドラッグでグラフの回転できる. freeglut環境ではマウスのホイールでグラフの拡大,縮小できる.

今後やりたいこと

main.cのグラフ描画周辺を別ファイルに移動する. グローバル変数をまとめて構造体で定義する.

3dgraph's People

Contributors

daiji256 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.