1 level Level swtich ButtonPress ButtonRelease Expose Level
|
|
|
- りえ あさま
- 7 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
第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
( ) 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
r3.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.*;
#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
Java演習(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
10/ / /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
[email protected] [email protected] 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
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 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
1) 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; ;
Java 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
ex01.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
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 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
Linux 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
(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
19 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(
2 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
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 - > - > - > - >
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
Local 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
r08.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
やさしい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
ex01.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
Java学習教材
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("
Java演習(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;
WebGL 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
programmingII2019-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
アプレットの作成
- 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!",
Chapter 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
Microsoft Word - C.....u.K...doc
C uwêííôöðöõ Ð C ÔÖÐÖÕ ÐÊÉÌÊ C ÔÖÐÖÕÊ C ÔÖÐÖÕÊ Ç Ê Æ ~ if eíè ~ for ÒÑÒ ÌÆÊÉÉÊ ~ switch ÉeÍÈ ~ while ÒÑÒ ÊÍÍÔÖÐÖÕÊ ~ 1 C ÔÖÐÖÕ ÐÊÉÌÊ uê~ ÏÒÏÑ Ð ÓÏÖ CUI Ô ÑÊ ÏÒÏÑ ÔÖÐÖÕÎ d ÈÍÉÇÊ ÆÒ Ö ÒÐÑÒ ÊÔÎÏÖÎ d ÉÇÍÊ
Condition 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.............................
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 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
K227 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
Applet 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
untitled
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);}
/*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
新・明解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,
10K 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
I 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..........................................
Java 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
£Ã¥×¥í¥°¥é¥ß¥ó¥°(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
ohp03.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
演算増幅器
スペースインベーダーもどき 1000 行プログラムの参考として スペースインベーダーもどきのプログラムを配布する いくつか習って いないものもあるので 補足の説明を加えていく 文字列の描画 文字の描画は glutbitmapcharacter() を用いる これは以下のようにして利用する int i; char *str = "Display String"; glcolor3f(0.0, 0.0,
2 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
r1.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
< 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 の係数
double 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.......................
II ( ) 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
r07.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
: : : 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);
ohp07.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
解きながら学ぶ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
I. (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
KeyListener 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)
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
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
Java 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.......................
< 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 シミュレーションソフト
2 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
< 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
r3.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));
< F2D F B834E2E6A7464>
ランダムウォーク [Java アプレット ] [Java アプレリケーョン ] 1. はじめに 酔っぱらいは前後左右見境なくふらつきます 酔っぱらいは目的地にたどり着こうと歩き回っているうちに何度も同じところに戻って来てしまったりするものです 今 酔っぱらいが数直線上の原点にいるとします 原点を出発して30 回ふらつくとき 30 回目に酔っぱらいがいる位置は 出発点である原点からどれくらい離れてしまっているのでしょうか
< F2D A839382CC906A2E6A7464>
ビュホンの針 1. はじめに [Java アプレット ] [Java アプリケーション ] ビュホン ( Buffon 1707-1788) は 針を投げて円周率 πを求めることを考えました 平面上に 幅 2aの間隔で 平行線を無数に引いておきます この平面上に長さ2bの針を落とすと この針が平行線と交わる確立 pは p=(2b) (aπ) 1 となります ただし b
r03.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 ---
I 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
/* 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
Java 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
PC 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
