1 level Level swtich ButtonPress ButtonRelease Expose Level
|
|
- りえ あさま
- 5 years ago
- Views:
Transcription
1 UNIX 4 2D/3D Grahpics,GUI : G E C D B B
2 1 level Level swtich ButtonPress ButtonRelease Expose Level Level level4c level
3 6 Level6: 2D levelx
4 1 level1 RGB 8bit 24bit RGB struct bitmap{ unsigned char r,g,b; } frame_buffer[x][y]; RGB X Window System X Window System (X ) (X ) / (γ) 1 1
5 2 (x, y) (x, y, 1) (x, y) (x, y ) (x 0, y 0 x, y ) [ x y 1 ] = [ x y 1 ] [ x 0 y 0 1 ] (S x, S y x, y ) [ x y 1 ] = [ x y 1 ] [ S x S y ] (θ ) [ x y 1 ] = [ x y 1 ] [ cosθ sinθ 0 sinθ cosθ ] 11 d = XOpenDisplay(NULL); XOpenDisplay() X Display ( Display *d) XOpenDisplay() DISPLAY NULL depth = DefaultDepth(d,0); ( 0 ) w = XCreateSimpleWindow(d,RootWindow(d,0),0,0,WIN WIDTH,WIN HEIGHT,0,0,0); X Window ID 1 Display* 2
6 2 Window ID 3,4 int (x,y) 5,6 unsigned int 7 unsigned int 8,9 unsigned long XSelectIinput(d,w,ExposureMask ButtonPressMask); 3 X ExposureMask ButtonPressMask XMapWindow(d,w); gc = XCreateGC(d,w,0,0); GC GC GC XCreateGC() pm = XCreatePixmap(d,w,WIN WIDTH,WIN HEIGHT,depth); ID 3 5 int 0 XPutImage(d,pm,gc,campusxim,0,0,0,0,WIN WIDTH,WIN HEIGHT); Display * 4 Ximage * 3
7 5,6 int Ximage X Y 7,8 int XNextEvent(d&event) XSelectInput CopyArea(d,pm,w,gc,0,0,WIN WIDTH,WIN HEIGHT,0,0); 2,3 Pixmap,Window 4 GC 5,6 int 7,8 unsigned int 9,10 int XFlush(d) Xlib X X XFlush() X XCloseDisplay(d) XOpenDisplay() X 12 [j04026@pw017 level1]% /level1 seaxwd 1: 2: 3:RGB 4: 5: 6: 4
8 7: >5 8: >07 1: 2: 3:RGB 4: 5: 6: 7: 8: >3 1: 2: 3:RGB 4: 5: 6: 7: 8: >4 >45 1: 2: 3:RGB 4: 5: 6: 7: 8: >8 level1]% 1,2,3,4 1: 2: 5
9 3: RGB 4: 13 XWDSet() XWDSet() 14 xwd xwd ( ) xwd Level1 : 2 Level2 frame buffer 21 1: #include <X11/Xlibh> 2: #include <X11/Xutilh> 6
10 Xlib X11/Xlibh X11/Xutilh include 17: main() 18: { 19: Display *d; 20: Window r, w, sw1, sw2, sw3, sw4, sw5, sw6, sw7, sw8, sw9; 21: GC gc; 22: Colormap colmap; 23: XColor col, exact; 24: XEvent event; Display Window GC Graphic Context Colormap ColorMap XColor XColor Colormap 36: w = XCreateSimpleWindow (d, r, 100, 100, 480, 360, 2, BlackPixel(d, 0), WhitePixel(d, 0)); 38: sw1 = XCreateSimpleWindow (d, w, 10, 5, 40, 20, 1, BlackPixel(d,0), WhitePixel(d,0)); 39: sw2 = XCreateSimpleWindow (d, w, 55, 5, 40, 20, 1, BlackPixel(d,0), WhitePixel(d,0)); 40: sw3 = XCreateSimpleWindow (d, w, 100, 5, 40, 20, 1, BlackPixel(d,0), WhitePixel(d,0)); 41: sw4 = XCreateSimpleWindow (d, w, 150, 5, 40, 20, 1, BlackPixel(d,0), WhitePixel(d,0)); 42: sw5 = XCreateSimpleWindow (d, w, 200, 5, 40, 20, 1, BlackPixel(d,0), WhitePixel(d,0)); 43: sw6 = XCreateSimpleWindow (d, w, 250, 5, 40, 20, 1, BlackPixel(d,0), WhitePixel(d,0)); 44: sw7 = XCreateSimpleWindow (d, w, 300, 5, 40, 20, 1, BlackPixel(d,0), WhitePixel(d,0)); 45: sw8 = XCreateSimpleWindow (d, w, 350, 5, 40, 20, 1, BlackPixel(d,0), WhitePixel(d,0)); 46: sw9 = XCreateSimpleWindow (d, w, 400, 5, 40, 20, 1, BlackPixel(d,0), WhitePixel(d,0)); 7
11 49: XMapWindow (d, w); 50: XMapSubwindows (d, w); 51: gc = XCreateGC (d, w, 0, 0); XCreateSimpleWindow ID ID ID ID X Y XMapWindow ID ID XMapSubwindows XCreateGC 54: XSelectInput (d, w, ButtonPressMask ButtonReleaseMask ExposureMask ); 55: XSelectInput (d, sw1, ButtonPressMask ExposureMask); 56: XSelectInput (d, sw2, ButtonPressMask ExposureMask); 57: XSelectInput (d, sw3, ButtonPressMask ExposureMask); 58: XSelectInput (d, sw4, ButtonPressMask ExposureMask); 59: XSelectInput (d, sw5, ButtonPressMask ExposureMask); 60: XSelectInput (d, sw6, ButtonPressMask ExposureMask); 61: XSelectInput (d, sw7, ButtonPressMask ExposureMask); 62: XSelectInput (d, sw8, ButtonPressMask ExposureMask); 63: XSelectInput (d, sw9, ButtonPressMask ExposureMask); Xclient XSelectInput() Prototype XSelectInput( Display* display, Window window, long event\_mask ); 8
12 event mask 7 1 ButtonPressMask ButtonPress 2 ButtonReleaseMask ButtonRelease 3 PointerMotionMask MotionNotify 4 ButtonMotionMask MotionNotify ( ) 5 Button1MotionMask MotionNotify 6 Button2MotionMask MotionNotify 7 Button3MotionMask MotionNotify ( ) event mask Expose Expose Expose X Expose X Expose
13 Expose 75: XDrawString(d, sw1, gc, 5, 10, "RESET", strlen("reset")); 77: XDrawString(d, sw2, gc, 5, 10, "QUIT", strlen("quit")); 79: XDrawString(d, sw3, gc, 10, 10, "STRAIGHT", strlen("straight")); 81: XDrawString(d, sw4, gc, 10, 10, "DOTT", strlen("dott")); 83: XDrawString(d, sw5, gc, 10, 10, "STRIPES", strlen("stripes")); 85: XDrawString(d, sw6, gc, 5, 10, "RED", strlen("red")); 87: XDrawString(d, sw7, gc, 5, 10, "BLUE", strlen("blue")); 89: XDrawString(d, sw8, gc, 5, 10, "YELLOW", strlen("yellow")); 91: XDrawString(d, sw9, gc, 5, 10, "PURPLE", strlen("purple")); 93: XNextEvent (d, &event); Display 97: switch (eventtype) { 99: case ButtonPress : 101: if(eventxanywindow == sw1) { 102: XClearWindow (d, w); 103: } 106: if(eventxanywindow == sw2){ 107: XCloseDisplay(d); 108: } 111: if(eventxanywindow == sw3){ 112: XSetLineAttributes (d, gc, 4, LineSolid, CapButt, JoinMiter); 10
14 114: XAllocNamedColor (d, colmap, color, &col, &exact); 115: XSetForeground(d, gc, colpixel); 116: } 160: if(eventxanywindow == sw9){ 161: strcpy(color, "purple"); 163: XAllocNamedColor (d, colmap, color, &col, &exact); 164: XSetForeground(d, gc, colpixel); 165: } 211 swtich swtich 212 ButtonPress XClearWindow sw1 (RESET) XCloseDisplay Xserver sw2 (QUIT) XSetLineAttributes 2(current pen ) LineSolid CapRound JoinMiter XAllocNamedColor() colmap DefaultColormap() ID color &col XColor 11
15 strcpy color 213 ButtonRelease XSetForeground draw line (ButtonPress) (ButtonRelease) 214 Expose Expose draw line 22 5: 23 12
16 frame buffer XClearWindow frame buffer XClearWindow XCleaWindow Level2 : 3 Level3 3 frame buffer 3 3 frame buffer frame buffer 31 l => r => l u => d => u 32 dat dat x,y,z 2 x,y,z coord[] cnct[] 13
17 redraw() trans() main(), 33 3 (cubedat,tridat,theagdat) #/level3 cubedat 6: cubedat #/level3 tridat 7: tridat #/level3 theagdat 14
18 8: theagdat 34 3 Level3 : 4 Level 4 frame_buffer ( 4 )? 41 level4c 2006 Watering KissMint 15
19 411 void makecolor(rcol,gcol,bcol,light,x,y) void afin(x0,y0,z0,x,y,z,xa,ya,za,a,b,c,mx,my,mz) void refresh() frame_buffer void plerefresh(int rco,int gco,int bco) buffer void makecube(display *dis,window W,GC gc,colormap cm) x void makecube2(display *dis,window W,GC gc,colormap cm) y void makecube3(display *dis,window W,GC gc,colormap cm) z void redraw(display *d, Window w, GC gc, Colormap cm) 412 #define X 500 /* */ #define Y 500 /* */ void makecube2(display *dis,window W,GC gc,colormap cm){ if( AY > 90 && AY < 270 ){ 16
20 plerefresh(0,1,0); afin(0,1,1,&x,&y,&z,ax,ay,az,ti,ti,ti,xmo,ymo,zmo); } allpaint(dis,w,gc,cm,start_xpoint,start_ypoint,finish_xpoint,finish_ypoint); void makecube3(display *dis,window W,GC gc,colormap cm){ } allpaint(dis,w,gc,cm,start_xpoint,start_ypoint,finish_xpoint,finish_ypoint); x y z x int main(){ start = clock(); end = clock(); } time time clock() 1 17
21 42 9: 1 10: [nw0459:~/info4/unix/lev4] j04059% /level4 time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = [nw0459:~/info4/unix/lev4_1] j04059% /level4 time = x = y = z = time = x = y = z =
22 time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = time = x = y = z = y y 90 double float double float double 0,609 float 0623 C double float double float C double 44 x,y,z x,y,z 19
23 Level4 ; 5 level5 Mesa OpenGL 51 OS Mac OSX 1046 C (gcc version ) OpenGL,GLUT 52 OpenGL GLUT 1 clock vertex 8 3 8*3 face A 0, 1, 2, 3 0 vertex[0] color (R,G,B) R G B,, float
24 : glbegin(gl_quads); 50: for (j = 0; j < 6; j++) { 51: glcolor3dv(color[j]); 52: for (i = 0; i < 4; i++) { 53: glvertex3dv(vertex[face[j][i]]); 54: } 55: } 56: glend(); 57: glutswapbuffers(); glbegin() GL QUADS 4 glcolor glvertex glcolor glvertex 3dv 6 for 6 57 glutswapbuffers() :int main(int argc, char *argv[]) 94:{ 95: clock_t start,end; //clock 96: start=clock(); // 97: 98: glutinit(&argc, argv); 99: glutinitdisplaymode(glut_rgba GLUT_DOUBLE GLUT_DEPTH); 100: glutcreatewindow("level5"); 101: glutdisplayfunc(display); 102: glutreshapefunc(resize); 21
25 103: glutkeyboardfunc(keyboard); 104: init(); 105: 106: end=clock(); // 107: // 108: printf("%f\n", (double)(end - start) / CLOCKS_PER_SEC); 109: 110: glutmainloop(); // 111: return 0; 112:} start 98 GLUT OpenGL X Window -display 99 3 GLUT RGBA RGB GLUT DOUBLE GLUT DEPTH end [nw0408:~/desktop/level5] j04008% aout
26 11: level level level4 X Window system Xlib OpenGL Xlib GLUT glutsolidcube() frame buffer Level5 : 6 Level6: 2D 2D 23
27 SVG XML 61 Mac OSX 1039 java version : 63 init() start() paint() 24
28 START init() start() paint() update() 13: - : ----Linejava import javaawt*; class Line extends Shape{ Line(Color c){ super(c); changepoints = new int[2][2]; thissetchangepoints(); } public void draw(graphics g){ gsetcolor(color); gdrawline(x1, y1, x2, y2); } public void setchangepoints(){ changepoints[0][0] = x1; changepoints[0][1] = y1; changepoints[1][0] = x2; changepoints[1][1] = y2; } public void setpoint(int n){ x1 = changepoints[0][0]; y1 = changepoints[0][1]; x2 = changepoints[1][0]; y2 = changepoints[1][1]; 25
29 setcenter(); } public boolean isintershape(int x, int y){ return false; } } AppletDrawTooljava { } public void actionperformed(actionevent e){ String s = ((Button)egetSource())getLabel(); { } if(sequals("line")){ shapesadd(new Line(color)); } update() paint() AppletDrawTooljava
30 { } public int whichdragg(int x, int y){ for(int i=shapessize()-1; i>=0; i--){ dragnum = ((Shape)shapesget(i))isInter(x, y); if(dragnum >= 0){ return i; } } return ; } public int whichinter(int x, int y){ for(int i=shapessize()-1; i>=0; i--){ if(((shape)shapesget(i))isintershape(x, y)) return i; } return ; } vector shapes Level6 SVG XML Java Applet XML java XMLEncoder XML FileOutputStream 27
31 Level6 : 7 levelx : Draw Tool Draw Tool 71 OS Mac OSX 1046 java (java version ) 72 level6 73 String String str stringjava string String 228: if(sequals("string")){ 229: if ((tfgettext())length() >=1){ 230: String str=tfgettext(); 231: shapesadd(new string(color,str)); 232: tfsettext(""); 234: } 235: } 28
32 stringjava 5:public string(color c,string s){ 6: super(c,s); 7: changepoints = new int[0][0]; 8: thissetchangepoints(); 9: } 10: public void draw(graphics g){ 11: gsetcolor(color); 12: gsetfont(new Font("Serif",FontPLAIN,36)); 13: gdrawstring(str,xcenter, ycenter); 14: } string s 2 super() Shape draw gdrawstring(str,x,y) (x,y) str 74 14: level6 29
33 ( ) enter 752 ( ) LevelX :, [1] 2006 UNIX Watering KissMint j04053/unixhtml [2] 2006 UNIX j04051/unixreport/indexhtml [3] X Window System(X ) X 01jsp [4] Quick introduction to XWindow Graphics naoki/cipintro/xlib/indexhtml [5] X 68user/xprogram/ 30
34 [6] Electronic Textbook index0 nis/cg/cgtxt/indexhtm [7] Welcome to Rio s Laboratory i/lab/ [8] [9] OpenGL [10] GLUT OpenGL tokoi/opengl/libgluthtml [11] X Japanese Documentation Pro ject [12] hira/hobby/edu/afin trans/math html [13] X-Window Programming mituhara/software e/indexhtml [14] Xlib-C Language X interface [15] Java [16] Java [17] II j02039/unix4/unix4html [18] JavaWorldOnline 31
第3章 OpenGL の基礎
3 OpenGL April 11, 2017 1 / 28 3.1 ( ) OpenGL OpenGL 2 / 28 3.2 OpenGL OpenGL OpenGL (Open Graphics Library) Silicon Graphics, Inc. 2 3 API (Application Program Interface) [4] UNIX OS Windows Macintosh
More information第3章 OpenGL の基礎
3 OpenGL April 20, 2012 1 / 23 31 ( ) OpenGL OpenGL 2 / 23 32 OpenGL OpenGL OpenGL (Open Graphics Library) Silicon Graphics, Inc 2 3 API (Application Program Interface) [4] UNIX OS Windows Macintosh CAD
More information( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h>
2007 12 5 1 2 2.1 ( ) 1 1: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 #define H WIN 400 // 8 #define W WIN 300 // 9
More information5. p.1/37
5. taiji@aihara.co.jp p.1/37 dx dt dy dt dz dt = σx + σy = xz + rx y = xy bz σ = 10, b = 8/3, r = 28, x 0 = 10, y 0 = 20, z 0 = 30 t < 10000δt (δt = 0.01) p.2/37 , 1991. Numerical Recipes in C Netlib LAPACK,
More information2 T ax 2 + 2bxy + cy 2 + dx + ey + f = 0 a + b + c > 0 a, b, c A xy ( ) ( ) ( ) ( ) u = u 0 + a cos θ, v = v 0 + b sin θ 0 θ 2π u = u 0 ± a
2 T140073 1 2 ax 2 + 2bxy + cy 2 + dx + ey + f = 0 a + b + c > 0 a, b, c A xy u = u 0 + a cos θ, v = v 0 + b sin θ 0 θ 2π u = u 0 ± a cos θ, v = v 0 + b tan θ π 2 < θ < π 2 u = u 0 + 2pt, v = v 0 + pt
More informationlibaux.dvi
AUX OpenGL 1 OpenGL (AUX libaux.a) OpenGL Programming Guide () OpenGL 1 OpenGL OS (API) OS OS OS OpenGL Windows Windows X X OpenGL Programming Guide AUX toolkit AUX OS OpenGL SGI OpenGL OS OpenGL AUX Windows
More information2 p.2 2 Java Hello0.class JVM Hello0 java > java Hello0.class Hello World! javac Java JVM java JVM : Java > javac 2> Q Foo.java Java : Q B
2 p.1 2 Java Java JDK Sun Microsystems JDK javac Java java JVM appletviewer IDESun Microsystems NetBeans, IBM 1 Eclipse 2 IDE GUI JDK Java 2.1 Hello World! 2.1.1 Java 2.1.1 Hello World Emacs Hello0.java
More informationr3.dvi
00 3 2000.6.10 0 Java ( 7 1 7 1 GSSM 1? 1 1.1 4 4a 4b / / 0 255 HTML X 0 255 16 (0,32,255 #0020FF Java xclock -bg #0020FF xclock ^C (Control C xclock 4c 1 import java.applet.applet; import java.awt.*;
More information#include <stdio.h> 2 #include <stdlib.h> 3 #include <GL/glut.h> 4 Program 1 (OpenGL GameSample001) 5 // 6 static bool KeyUpON = false; // 7 sta
1 1. 1 #include 2 #include 3 #include 4 Program 1 (OpenGL GameSample001) 5 // 6 static bool KeyUpON = false; // 7 static bool KeyDownON = false; // 8 static bool KeyLeftON
More informationJava演習(4) -- 変数と型 --
50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends
More information10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV
tutimura@mist.i.u-tokyo.ac.jp kaneko@ipl.t.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 12 11 p.1/33 10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20
More information第13回「ウィンドウシステム」
1 ソフトウェアアークテクチャ 第 13 回ウインドウシステム 環境情報学部 萩野達也 スライド URL https://vu5.sfc.keio.ac.jp/slide/ CUI から GUI へ CUI, CLI, TUI CUI = Character(-based) User Interface, Console User Interface CLI = Command Line Interface
More information2 p.2 2 Java Hello0.class JVM Hello0 java > java Hello0.class Hello World! javac Java JVM java JVM : Java > javac 2> Q Foo.java Java : Q B
2 p.1 2 Java Java JDK Sun Microsystems Oracle JDK javac Java java JVM appletviewer IDESun Microsystems NetBeans, IBM 1 Eclipse 2 IDE GUI JDK Java 2.1 Hello World! 2.1.1 Java 2.1.1 Hello World Emacs Hello0.java
More information1) OOP 2) ( ) 3.2) printf Number3-2.cpp #include <stdio.h> class Number Number(); // ~Number(); // void setnumber(float n); float getnumber();
: : :0757230G :2008/07/18 2008/08/17 1) OOP 2) ( ) 3.2) printf Number3-2.cpp #include class Number Number(); // ~Number(); // void setnumber(float n); float getnumber(); private: float num; ;
More informationJava 2 p.2 2 Java Hello0.class JVM Hello0 java > java Hello0.class Hello World! javac Java JVM java JVM : Java > javac 2> Q Foo.java Java : Q 2.
Java 2 p.1 2 Java Java JDK Sun Microsystems Oracle JDK javac Java java JVM appletviewer IDE Sun Microsystems NetBeans, IBM 1 Eclipse 2 IDE GUI JDK Java 2.1 Hello World! 2.1.1 Java 2.1.1 Hello World Emacs
More informationr2.dvi
2002 2 2003.1.29 1 2.1-2.3 (1) (2) 2.4-2.6 (1)OO (2)OO / 2.7-2.10 (1)UML (2) Java 3.1-3.3 (1) (2)GoF (3)WebSphere (4) 3.4-3.5 3.6-3.9 Java (?) 2/12( ) 20:00 2 (2 ) 3 Java (?)1 java.awt.frame Frame 1 import
More informationex01.dvi
,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) double
More information2 p.2 2 Java Hello0.class JVM Hello0 java > java Hello0.class Hello World! javac Java JVM java JVM : Java > javac 2> Q Foo.java Java : Q B
2 p.1 2 Java Java JDK Sun Microsystems Oracle JDK javac Java java JVM appletviewer IDESun Microsystems NetBeans, IBM 1 Eclipse 2 IDE GUI JDK Java 2.1 Hello World! 2.1.1 Java 2.1.1 Hello World Emacs Hello0.java
More informationLinux XScreenSaver T020074
Linux XScreenSaver T020074 Linux XScreenSaver XScreenSaver Linux Linux Linux X Window System X Window System Xlib XScreenSaver X Window System Xlib XScreenSaver Xlib vroot.h Xlib XScreenSaver Linux Linux
More information(300, 150) 120 getchar() HgBox(x, y, w, h) (x, y), w, h #include <stdio.h> #include <handy.h> int main(void) { int i; double w, h; } HgO
Handy Graphic for Handy Graphic Version 0.5 2008-06-09 1 Handy Graphic Handy Graphic C Handy Graphic Handy Graphic Mac OS X Handy Graphic HgDisplayer Handy Graphic HgDisplayer 2 Handy Graphic 1 Handy Graphic
More information19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics;
19 3!!...... (+) (>) (++) (+=) for while 3.1!! 3.1.1 50 20 20 5 (20, 20) 3.1.1 (1)(Blocks1.java) public class Blocks1 extends JApplet { public void paint(graphics g){ 5 g.drawrect( 20, 20, 50, 20); g.drawrect(
More information2 1 Web Java Android Java 1.2 6) Java Java 7) 6) Java Java (Swing, JavaFX) (JDBC) 7) OS 1.3 Java Java
1 Java Java 1.1 Java 1) 2) 3) Java OS Java 1.3 4) Java Web Start Web / 5) Java C C++ Java JSP(Java Server Pages) 1) OS 2) 3) 4) Java Write Once, Run Anywhere 5) Java Web Java 2 1 Web Java Android Java
More information1 1. Program 1 OpenCV (OpenCV Sample001) 1 /* 2 - > - > - >VC++ 3 ( ) 4 C:\opencv\build\include 5 ( ) 6 C:\opencv\build\x86\vc10\lib 7 - > - > - > - >
1 1. Program 1 OpenCV (OpenCV Sample001) 1 /* 2 - > - > - >VC++ 3 ( ) 4 C:\opencv\build\include 5 ( ) 6 C:\opencv\build\x86\vc10\lib 7 - > - > - > - > 8 (240 O p e n C V ) 9 opencv_core240d.lib 10 opencv_imgproc240d.lib
More informationuntitled
2004/12/21 2/2 (11/16) DT-MRI (11/30) /OpenGL 12/7 12/14 (12/21) 1/11 (1/18) OpenGL ~ ~ OpenGL Silicon Graphics, OpenGL ~ ~ OpenGL OpenGL Utility Library (GLU) OpenGL. OpenGL. OpenGL Utility Toolkit (GLUT)
More informationLocal variable x y i paint public class Sample extends Applet { public void paint( Graphics gc ) { int x, y;... int i=10 ; while ( i < 100 ) {... i +=
Safari AppletViewer Web HTML Netscape Web Web 13-1 Applet Web Applet init Web paint Web start Web HTML stop destroy update init Web paint start Web update Event Driven paint Signature Overwriting Overriding
More informationr08.dvi
19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev
More information演算増幅器
コンピュータグラフィックス 2 前回は GLUT を使った簡単な 2 次元グラフィックスについて習った 今週は以下の項目について 補足していく イベント駆動型プログラムの動作について コンピュータグラフィックスの座標系 イベント駆動型プログラム従来のプログラムとの違いこれまでに学習してきたプログラムは上から下に順次実行され 条件分岐や繰り返し処理によって プログラムの流れ (flow: フロー )
More informationラムの学習環境は次のようなものがある. OS が Microsoft Windows の場合では Visual Studio が標準的な開発環境であり, コンパイラ, ライブラリ, デバッガ, エディタなどの開発に必要なツールが統合化されている. また複数の言語 (C, C++, C#, Pytho
2.1 イベント駆動型プログラミング 2.1.1 フロー駆動型とイベント駆動型プログラムは上から下へのフロー ( 流れ ) に従って実行される. このようなプログラムをフロー駆動型プログラムと呼ぶ. それに対し, イベント ( 出来事 ) に応じで対応する処理が実行されるプログラムをイベント駆動型プログラムと呼ぶ. イベントの例はマウスのボタンが押さる, マウスの座標位置が変わる, キーが押される,
More informationやさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF
pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) 3 5 14 18 21 23 23 24 28 29 29 31 32 34 35 35 36 38 40 44 44 45 46 49 49 50 pref : 2004/6/5 (11:8) 50 51 52 54 55 56 57 58 59 60 61
More informationr6.dvi
I 2005 6 2005.11.18 1 1.1 2 Hello, World public class r5ex2 extends JApplet { Font fn = new Font("Helvetica", Font.BOLD, 24); g2.setfont(fn); for(int i = 0; i < 10; ++i) { g2.setpaint(new Color(100+i*5,
More information第7章 レンダリング
7 April 11, 2017 1 / 59 7.1 ( ) CG 3 ( ) 2 / 59 7.2 7.2.1 ( ) 3 (rendering) 1 / (hidden line/surface calculation) a (outer normal algorithm) b Z (Z-buffer algorithm) c (scan-line algorithm) 2 (shading)
More information第7章 レンダリング
7 May 18, 2012 1 / 60 71 ( ) CG 3 ( ) 2 / 60 72 71 ( ) 3 (rendering) 1 / (hidden line/surface calculation) a (outer normal algorithm) b Z (Z-buffer algorithm) c (scan-line algorithm) 2 (shading) a (flat
More informationJava演習(2) -- 簡単なプログラム --
Java public class Hello Hello (class) (field)... (method)... Java main Hello World(Hello.java) public class Hello { public static void main(string[ ] args) { public() (package) Hello World(Hello.java)
More informationr4.dvi
00 4 2000.6.24 0 GUI GUI GUI GUI 1 1.1 3 2 1 import java.applet.applet; import java.awt.*; public class r3ex2 extends Applet { Figure[] figs = new Figure[]{ new Circle(Color.blue, 100.0, 100.0, 30.0, 1.1,
More informationex01.dvi
,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double
More informationJava学習教材
Java 2016/4/17 Java 1 Java1 : 280 : (2010/1/29) ISBN-10: 4798120987 ISBN-13: 978-4798120980 2010/1/29 1 Java 1 Java Java Java class FirstExample { public static void main(string[] args) { System.out.println("
More informationohp08.dvi
19 8 ( ) 2019.4.20 1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: 2 (2) NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( 2) 3 (3) head cur tail head cur prev data
More informationJava演習(9) -- クラスとメソッド --
Java (9) Java (9) Java (9) 3 (x, y) x 1 30 10 (0, 50) 1 2 10 10 (width - 10, 80) -2 3 50 10 (width / 2, 110) 2 width 3 (RectMove4-1.java) import javax.swing.japplet; import javax.swing.timer; import java.awt.graphics;
More informationWebGL OpenGL GLSL Kageyama (Kobe Univ.) Visualization / 57
WebGL 2014.04.15 X021 2014 3 1F Kageyama (Kobe Univ.) Visualization 2014.04.15 1 / 57 WebGL OpenGL GLSL Kageyama (Kobe Univ.) Visualization 2014.04.15 2 / 57 WebGL Kageyama (Kobe Univ.) Visualization 2014.04.15
More informationprogrammingII2019-v01
II 2019 2Q A 6/11 6/18 6/25 7/2 7/9 7/16 7/23 B 6/12 6/19 6/24 7/3 7/10 7/17 7/24 x = 0 dv(t) dt = g Z t2 t 1 dv(t) dt dt = Z t2 t 1 gdt g v(t 2 ) = v(t 1 ) + g(t 2 t 1 ) v v(t) x g(t 2 t 1 ) t 1 t 2
More informationSafari AppletViewer Web HTML Netscape Web Web 15-1 Applet Web Applet init Web paint Web start Web HTML stop destroy update init Web paint start Web up
Safari AppletViewer Web HTML Netscape Web Web 15-1 Applet Web Applet init Web paint Web start Web HTML stop destroy update init Web paint start Web update Event Driven paint Signature Overwriting Overriding
More informationアプレットの作成
- 1 - import java.applet.applet; import java.awt.graphics; public class HelloWorld extends Applet { public void init() { resize(150,60) ; public void paint ( Graphics g ) { g.drawstring("hello, world!",
More information2 : 2008/12/ /01/ G :
2 : 2008/12/08 2008/01/16 075730G : 1 project draw main.cpp 1 draw main.cpp /* * main.cpp * draw * * Created by C-T on 08/12/08. * Copyright 2008 MyCompanyName. All rights reserved. * */ #include
More informationChapter JDK KeyListener keypressed(keyevent e ) keyreleased(keyevent e ) keytyped(keyevent e ) MouseListener mouseclicked(mouseeven
Chapter 11. 11.1. JDK1.1 11.2. KeyListener keypressed(keyevent e ) keyreleased(keyevent e ) keytyped(keyevent e ) MouseListener mouseclicked(mouseevent e ) mousepressed(mouseevent e ) mousereleased(mouseevent
More information< F2D E E6A7464>
ピタゴラス数 [Java アプレット ] [Java アプリケーション ] 1. はじめに 2 2 2 三平方の定理 a +b =c を満たす3つの自然数の組 ( a, b, c) をピタゴラス数と言います ピタゴラス数の最も簡単な例として (3,4,5) がありますね このピタゴラス数を求めるには ピタゴラスの方法とプラトンの方法の2つの方法があります 2 2 ピタゴラス数 (a,b,c) に対して
More informationMicrosoft Word - C.....u.K...doc
C uwêííôöðöõ Ð C ÔÖÐÖÕ ÐÊÉÌÊ C ÔÖÐÖÕÊ C ÔÖÐÖÕÊ Ç Ê Æ ~ if eíè ~ for ÒÑÒ ÌÆÊÉÉÊ ~ switch ÉeÍÈ ~ while ÒÑÒ ÊÍÍÔÖÐÖÕÊ ~ 1 C ÔÖÐÖÕ ÐÊÉÌÊ uê~ ÏÒÏÑ Ð ÓÏÖ CUI Ô ÑÊ ÏÒÏÑ ÔÖÐÖÕÎ d ÈÍÉÇÊ ÆÒ Ö ÒÐÑÒ ÊÔÎÏÖÎ d ÉÇÍÊ
More informationCondition DAQ condition condition 2 3 XML key value
Condition DAQ condition 2009 6 10 2009 7 2 2009 7 3 2010 8 3 1 2 2 condition 2 3 XML key value 3 4 4 4.1............................. 5 4.2...................... 5 5 6 6 Makefile 7 7 9 7.1 Condition.h.............................
More information2 p.2 2 Java Hello0.class JVM Hello0 java > java Hello0.class Hello World! javac Java JVM java JVM : Java > javac 2> Q Foo.java Java : Q B
2 p.1 2 Java Java JDK Sun Microsystems Oracle JDK javac Java java JVM IDESun Microsystems Oracle NetBeans, IBM 1 Eclipse 2, JetBrains IntelliJ IDEA IDE GUI JDK Java 2.1 Hello World! 2.1.1 Java 2.1.1 GUI
More informationK227 Java 2
1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html
More informationApplet java.lang.object java.awt.component java.awt.container java.awt.panel java.applet.applet
13 Java 13.9 Applet 13.10 AppletContext 13.11 Applet java.lang.object java.awt.component java.awt.container java.awt.panel java.applet.applet Applet (1/2) Component GUI etc Container Applet (2/2) Panel
More informationuntitled
II yacc 005 : 1, 1 1 1 %{ int lineno=0; 3 int wordno=0; 4 int charno=0; 5 6 %} 7 8 %% 9 [ \t]+ { charno+=strlen(yytext); } 10 "\n" { lineno++; charno++; } 11 [^ \t\n]+ { wordno++; charno+=strlen(yytext);}
More information( ) p.1 x y y = ( x ) 1 γ γ = filtergamma.java import java.applet.*; public class filtergamma extends Applet{ Image img; Image new_img; publi
e001d 00 1 1 ( ) Figure 1: 1 shikaku.java import java.applet.*; public class shikaku extends Applet{ public void paint( Graphics g) { g.drawrect(,,0,0 ); // x(,) width = 0,height=0 g.drawrect(,,0,0 );
More information/*p7-1-1*/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 /* e8.c Copyright (c) 2003 by T. HAYASHI and
More information新・明解Java入門
537,... 224,... 224,... 32, 35,... 188, 216, 312 -... 38 -... 38 --... 102 --... 103 -=... 111 -classpath... 379 '... 106, 474!... 57, 97!=... 56 "... 14, 476 %... 38 %=... 111 &... 240, 247 &&... 66,
More information10K pdf
#1 #2 Java class Circle { double x; // x double y; // y double radius; // void set(double tx, double ty){ x = tx; y = ty; void set(double tx, double ty, double r) { x = tx; y = ty; radius = r; // Circle
More informationI java A
I java 065762A 19.6.22 19.6.22 19.6.22 1 1 Level 1 3 1.1 Kouza....................................... 3 1.2 Kouza....................................... 4 1.3..........................................
More informationB02-095 2007 2 15 1 3 2 4 2.1............................. 4 2.2........................................ 5 2.3........................................ 6 3 7 3.1................................. 7 3.2..............................
More informationJava Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225
Java Java Java Java Java 4 p35 4-2 * *** ***** *** * Unix p36 4-3 a,b,c,d 100,200,250,500 a*b = 20000 a*b+c = 20250 a*b+c*d = 145000 (a+b)*(c+d) = 225000 a+b*c+d = 50600 b/a+d/c = 4 p38 4-4 (1) mul = 1
More information£Ã¥×¥í¥°¥é¥ß¥ó¥°(2018) - Âè11²ó – ½ÉÂꣲ¤Î²òÀ⡤±é½¬£² –
(2018) 11 2018 12 13 2 g v dv x dt = bv x, dv y dt = g bv y (1) b v 0 θ x(t) = v 0 cos θ ( 1 e bt) (2) b y(t) = 1 ( v 0 sin θ + g ) ( 1 e bt) g b b b t (3) 11 ( ) p14 2 1 y 4 t m y > 0 y < 0 t m1 h = 0001
More informationohp03.dvi
19 3 ( ) 2019.4.20 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void int main(int argc, char *argv[]) {... 2 (2) argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0
More information演算増幅器
スペースインベーダーもどき 1000 行プログラムの参考として スペースインベーダーもどきのプログラムを配布する いくつか習って いないものもあるので 補足の説明を加えていく 文字列の描画 文字の描画は glutbitmapcharacter() を用いる これは以下のようにして利用する int i; char *str = "Display String"; glcolor3f(0.0, 0.0,
More information2 2 GLUI 2 GLUI 2.1 GLUI GLUI OpenGL OpenGL glut OpenGL glut C++ Linux, Windows (Visual C++, gcc), Macintosh glut glut GUI glut GUI CG glmultmatrix()
1 20 (2) OpenGL+GUI(GLUI) 3DCG TA 2008 10 27 1 OpenGL OpenGL GUI GLUI 1.1 http://www.cyber.t.u-tokyo.ac.jp/~kuni/enshu2008/ 1.2 TA 1.3 2008/12/4( ) EyeToy 2 2 GLUI 2 GLUI 2.1 GLUI GLUI OpenGL OpenGL glut
More information< F2D B825082CC96E291E82E6A7464>
3x+1 の問題 [Java アプレット ] [Java アプリケーション ] 1. はじめに どんな自然数から始めても良いので その数が偶数ならば2で割り 奇数ならば3 倍して1を加えることを繰り返します そうすると どんな自然数から始めても必ず1になるというのはほんとうなのでしょうか 例えば 11から始めると 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 となります
More informationr1.dvi
2006 1 2006.10.6 ( 2 ( ) 1 2 1.5 3 ( ) Ruby Java Java Java ( Web Web http://lecture.ecc.u-tokyo.ac.jp/~kuno/is06/ / ( / @@@ ( 3 ) @@@ : ( ) @@@ (Q&A) ( ) 1 http://www.sodan.ecc.u-tokyo.ac.jp/cgi-bin/qbbs/view.cgi
More information< F2D82518E9F8AD CC834F CC8CFC82AB82C68D4C>
2 次関数のグラフの向きと広がり [Java アプレット ] [Java アプリケーション ] 1. はじめに 2 2 y=ax のグラフについて x の係数 aが正のときと負のときでは グラフにどのような違いがあるでしょうか 2 2 y=ax のグラフについて x の係数 aが正のとき 係数 aの値が大きくなるにつれて グラフの広がりはどうなるでしょうか 2 2 y=ax のグラフについて x の係数
More informationdouble float
2015 3 13 1 2 2 3 2.1.......................... 3 2.2............................. 3 3 4 3.1............................... 4 3.2 double float......................... 5 3.3 main.......................
More informationII ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D
II 8 2003 11 12 1 6 ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 Daisuke 8 =>. 73 Daisuke 35 Hiroshi 64 Ichiro 87 Junko
More informationr07.dvi
19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1
More information: : : TSTank 2
Java (8) 2008-05-20 Lesson6 Lesson5 Java 1 Lesson 6: TSTank1, TSTank2, TSTank3 java 2 car1 car2 Car car1 = new Car(); Car car2 = new Car(); car1.setcolor(red); car2.setcolor(blue); car2.changeengine(jet);
More informationohp07.dvi
19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5
More information解きながら学ぶJava入門編
44 // class Negative { System.out.print(""); int n = stdin.nextint(); if (n < 0) System.out.println(""); -10 Ÿ 35 Ÿ 0 n if statement if ( ) if i f ( ) if n < 0 < true false true false boolean literalboolean
More informationC B
C 095707B 2010 6 8 1 LEVE1 2 1.1 LEVEL 1.1................................................ 2 1.1.1 1................................................ 2 1.1.2 1.2..............................................
More informationOpenGL GLSL References Kageyama (Kobe Univ.) Visualization / 58
WebGL *1 2013.04.23 *1 X021 2013 LR301 Kageyama (Kobe Univ.) Visualization 2013.04.23 1 / 58 OpenGL GLSL References Kageyama (Kobe Univ.) Visualization 2013.04.23 2 / 58 Kageyama (Kobe Univ.) Visualization
More informationI. (i) Foo public (A). javac Foo.java java Foo.class (C). javac Foo java Foo (ii)? (B). javac Foo.java java Foo (D). javac Foo java Foo.class (A). Jav
2018 06 08 11:00 12:00 I. I III II. III. IV. ( a d) V. VI. 80 40 40 100 60 : A ActionListener aa addactionlistener AE ActionEvent K KeyListener ak addkeylistener KE KeyEvent M MouseListener am addmouselistener
More informationKeyListener init addkeylistener addactionlistener addkeylistener addkeylistener( this ); this.addkeylistener( this ); KeyListener public void keytyped
KeyListener keypressed(keyevent e) keyreleased(keyevent e) keytyped(keyevent e) MouseListener mouseclicked(mouseevent e) mousepressed(mouseevent e) mousereleased(mouseevent e) mouseentered(mouseevent e)
More informationj x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E
8 9 7 6 4 2 3 5 1 j x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E a n 1 H = ae l j, j=1 l j = x j+1 x j, x n x 1 = n 1 j=1 l j, l j = ±l l > 0) n 1 H = ϵ l j, j=1 ϵ e x x
More informationJava updated
Java 2003.07.14 updated 3 1 Java 5 1.1 Java................................. 5 1.2 Java..................................... 5 1.3 Java................................ 6 1.3.1 Java.......................
More information< F2D82518E9F8AD CC95BD8D7388DA93AE2E6A7464>
2 次関数のグラフの平行移動 [Java アプレット ] [Java アプリケーション ] 1. はじめに 2 2 y=ax のグラフとy=a(x-b) +c のグラフは 位置は違うけれど 形も広がりも全く同じです 2 2 y=a(x-b) +c のグラフは y=ax のグラフをx 軸方向に ( 右方向に ) +b y 軸方向に ( 上方向に ) +c だけ平行移動したものです 2 シミュレーションソフト
More informationr2.dvi
2 /Fitzz 2012.10.16 1 Reading 1.1 HCI bit ( ) HCI ( ) ( ) ( ) HCI ( ) HCI ( ) ^_^; 1 1.2,,!,, 2000 1.3 D. A.,,?,, 1990 1? 1 (interface) ( ) ( / ) (User Interface, UI) 2 :? import java.awt.*; import java.awt.event.*;
More information2 p.2 2 Java > javac Hello0.java Hello0.class JVM Hello0 java > java Hello0.class Hello World! javac Java JVM java JVM : Java > javac 2> Q Foo.j
2 p.1 2 Java Java JDK Sun Microsystems Oracle JDK javac Java java JVM appletviewer IDESun Microsystems Oracle NetBeans, IBM 1 Eclipse 2, JetBrains IntelliJ IDEA IDE GUI JDK Java 2.1 Hello World! 2.1.1
More information2008 DS T050049
DS T050049. PSP DS DS DS RPG DS OS Windows XP DevkiPro OS DS CPU ARM devkitarm MSYS MinGW MSYS MinGW Unix OS C++ C++ make nds nds DS DS micro SD Card nds DS DS DS nds C Java C++ nds nds DS 2008 DS T050049
More informationJava (7) Lesson = (1) 1 m 3 /s m 2 5 m 2 4 m 2 1 m 3 m 1 m 0.5 m 3 /ms 0.3 m 3 /ms 0.6 m 3 /ms 1 1 3
Java (7) 2008-05-20 1 Lesson 5 1.1 5 3 = (1) 1 m 3 /s 1 2 3 10 m 2 5 m 2 4 m 2 1 m 3 m 1 m 0.5 m 3 /ms 0.3 m 3 /ms 0.6 m 3 /ms 1 1 3 1.2 java 2 1. 2. 3. 4. 3 2 1.3 i =1, 2, 3 V i (t) 1 t h i (t) i F, k
More information< F2D834F838C A815B A CC>
グレゴリー ライプニッツの公式 [Java アプレット ] [Java アプリケーション ] 1. はじめに 次のグレゴリー ライプニッツの公式を用いて π の近似値を求めてみましょう [ グレゴリー ライプニッツの公式 ] π 4 =1-1 3 + 1 5-1 7 + 1 9-1 + 11 シミュレーションソフト グレゴリー ライプニッツの公式による π の近似 を使って π の近似値が求まる様子を観察してみてください
More information< F2D82518CC282CC D2E6A7464>
2 個のさいころ 1. はじめに [Java アプレット ] [Java アプリケーション ] 2 個のさいころを同時に投げたときの目の出方を考えてみましょう この 2 個のさいころをそれぞれ さいころ Ⅰ さいころ Ⅱ とすると その目の出方は順に 1 1 2 1 3 1 4 1 5 1 6 1 1 2 2 2 3 2 4 2 5 2 6 2 1 3 2 3 3 3 4 3 5 3 6 3 1 4
More informationr3.dvi
10 3 2010.9.21 1 1) 1 ( 1) 1: 1) 1.0.1 : Java 1 import java.awt.*; import javax.swing.*; public class Sample21 extends JPanel { public void paintcomponent(graphics g) { g.setcolor(new Color(255, 180, 99));
More information< F2D B838A835882CC8CF68EAE2E6A7464>
ウォーリスの公式 [Java アプレット ] [Java アプリケーション ] 1. はじめに 次のウォーリスの公式を用いて π の近似値を求めてみましょう [ ウォーリスの公式 ] π=2{ 2 2 4 4 6 6 1 3 3 5 5 7 シミュレーションソフト ウォーリスの公式による π の近似 を使って π の近似値が求まる様子を観察してみてください 2.Java アプレット (1) Javaプログラムリスト
More information< F2D F B834E2E6A7464>
ランダムウォーク [Java アプレット ] [Java アプレリケーョン ] 1. はじめに 酔っぱらいは前後左右見境なくふらつきます 酔っぱらいは目的地にたどり着こうと歩き回っているうちに何度も同じところに戻って来てしまったりするものです 今 酔っぱらいが数直線上の原点にいるとします 原点を出発して30 回ふらつくとき 30 回目に酔っぱらいがいる位置は 出発点である原点からどれくらい離れてしまっているのでしょうか
More information< F2D A839382CC906A2E6A7464>
ビュホンの針 1. はじめに [Java アプレット ] [Java アプリケーション ] ビュホン ( Buffon 1707-1788) は 針を投げて円周率 πを求めることを考えました 平面上に 幅 2aの間隔で 平行線を無数に引いておきます この平面上に長さ2bの針を落とすと この針が平行線と交わる確立 pは p=(2b) (aπ) 1 となります ただし b
More informationuntitled
Java 1 1 Java 1.1 Java 1.2 Java JavaScript 2 2.1 2.2 2.3 Java VM 3 3.1 3.2 3.3 3.4 4 Java 4.1 Java 4.2 if else 4.3 switch case 4.4 for 4.5 while 4.6 do-while 4.7 break, continue, return 4.8 try-catch-finally
More informationr03.dvi
19 ( ) 019.4.0 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void... argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0 a a \0 b b b \0 c c c \0 1: // argdemo1.c ---
More information2
次の課題 1~7 の を埋めてプログラムを完成させよ 1. 整数型の配列に格納されたデータの総和を計算し, その結果を出力するプログラムである このプログラムの処理手順を次に示す 1 配列の格納するデータの個数 n (n>0) を入力する 2n の大きさで配列を確保する 3 配列に n 個分のデータを格納する 4 配列の総和を求める 5 総和を出力する import java.io.*; public
More informationI HTML HashMap (i) (ii) :.java import java.net.*; import java.io.*; import java.util.hashmap; public class SimpleStopWatch { public static voi
II Java 10 2 12 10:30 12:00 I. I III II. III. IV. ( a d) V. : this==null, T == N A ActionListener C class D actionperformed G getsource I implements K KeyListener J JApplet L addmouselistener M MouseListener
More information/* sansu1.c */ #include <stdio.h> main() { int a, b, c; /* a, b, c */ a = 200; b = 1300; /* a 200 */ /* b 200 */ c = a + b; /* a b c */ }
C 2: A Pedestrian Approach to the C Programming Language 2 2-1 2.1........................... 2-1 2.1.1.............................. 2-1 2.1.2......... 2-4 2.1.3..................................... 2-6
More informationJava 3 p.2 3 Java : boolean Graphics draw3drect fill3drect C int C OK while (1) int boolean switch case C Calendar java.util.calendar A
Java 3 p.1 3 Java Java if for while C 3.1 if Java if C if if ( ) 1 if ( ) 1 else 2 1 1 2 2 1, 2 { Q 3.1.1 1. int n = 2; if (n
More informationJava言語 第1回
Java 言 語 第 6 回 Javaアプレット 知 的 情 報 システム 工 学 科 久 保 川 淳 司 kubokawa@me.it-hiroshima.ac.jp アプレットの 概 要 Javaアプレットプログラムの 動 作 Javaアプレット ***.class htmlファイル ***.html ブラウザ(IE Firefox 等 ) Java VM Webサーバ ローカルファイル クライアントコンピュータ
More informationMicrosoft PowerPoint - 04.pptx
初期化 コールバック関数の登録 glutmainloop() 描画関数 マウス処理関数 キーボード処理関数などの関数ポインタを登録する イベント待ちの無限ループ 再描画? no マウス入力? no キーボード入力? no yes yes yes 描画関数の呼び出し マウス処理関数の呼び出し キーボード処理関数の呼び出し void keyboard(unsigned char key, int x,
More informationThread
14 2013 7 16 14.1....................................... 14 1 14.2 Thread................................... 14 1 14.3............................. 14 5 14.4....................................... 14 10
More information< F2D89BA8EE882C E6A7464>
下手な鉄砲も数撃ちゃ当たる!! [Java アプレット ] [Java アプリケーション ] 1. はじめに 鉄砲を10 回撃つと1 回当たる腕前の人が鉄砲を撃ちます 下枠の [ 自動 10 回 ] または [ 自動 50 回 ] または [ 自動 100 回 ] をクリックすると それぞれ10 回 50 回 100 回 実験を繰り返します ただし 1 回の実験につき20 発の鉄砲を発射します シミュレーションソフト
More information< F2D A838B838D96402E6A7464>
モンテカルロ法 [Java アプレット ] [Java アプリケーション ] 1. はじめに 一辺の長さが 2 の正方形とそれに内接する半径 1 の円が紙に書かれています この紙の上からたくさんのゴマをばらまきます 正方形の中に入ったゴマの数と そのうちで円の中に入ったゴマの数も数えます さあ このゴマの数からどうやって円周率 π を求めるのでしょうか 一辺の長さ2の正方形の面積は4で
More informationPC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU
1. 1.1. 1.2. 1 PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 2. 2.1. 2 1 2 C a b N: PC BC c 3C ac b 3 4 a F7 b Y c 6 5 a ctrl+f5) 4 2.2. main 2.3. main 2.4. 3 4 5 6 7 printf printf
More information