Raptor运算符号函数子过程介绍大全.doc
33页Raptor运算符号、函数、子过程介绍大全Raptor symbols 符号(六个)The six symbols used in Raptor are displayed in the Symbol Window in the upper left corner of the main win dow:赋值 Assignmentx <- x + 1 用 Set x to x+1调用 Call 及 subchartsgraphics routines and other instructor-provided procedures 及 subcharts输入In put输出Output分支 Selection循环 Loop ControlMath in Raptor (数学运算符)Un ary Mi nus (-)负号例如,x值分别为7,-3,3,则-x的值为-7 ; -x的值为3,---x值为-3Exp onen tiati on (八 or ** ) 指数运算2A3 的值为 8; -3**2 的值为 9 ( =(-3)*(-3))* , / , REM, MOD ——乘、除、取余函数floor ( 5 / 2 ) ——整除函数? =2xyx REM yx MOD y103 I1137211162009.530.50.59.52.522-103-1210-31-2常用于判断某数是否奇偶数注:三种除运算除数均不可为 0,否则将显示“ run-time error+ , - 加减运算非三角函数In Assignments:x_magnitude <- abs(x)product <- eFog(factorl) + Iog(factor2)) In Select and Loop Exit Comparisons: log(x) > 0.0sqrt(cA2) <= sqrt(aA2 + bA2)random > 0.5 and abs(x) < 100.0 以字母顺序列出非三角函数:求绝对值 ABS例如 abs(-3.7) 为 3.7CEILING (与 FLOOR 相对)ceiling(math_expression)为 4, ceiling(-4.1) 为 -4例如 ceiling(15.9) 为 16, ceiling(3.1) FLOORvariable <- floor(math_expression) floor(15.9) is 15, floor(-4.1) is -5E 指数幂eAxe 为约等于 2.7 的对数常数LOG 对数log(math_expression)参数不可为 0,否则 run-time errorMAXmax(math_expression, max_expression)例如: max(5,7) 为 7.MINmin(math_expression, max_expression)例如: min(5,7) 为 5.PI返回圆周率值 3.14159.POWERMODpowermod(base, exp, modulus)返回值为 ((baseAexp) mod modulus).RSA public key en crypti on and decrypti onbases and exponents too large for the Raptor exponentiation operator can still be used for en crypti on.RANDOMRan don返回[0.0,1.0) 间的一个随机数例如:floor((random * 6) + 1).SQRTsqrt(math_expressi on)参数不可为负数三角函数SINsin (expressio n」n _radia ns)COScos(expressio n_in _radia ns)TANtan (expressio n」n _radia ns)COTcot(expressio n」n_ radia ns)ARCSINarcs in( expressi on)ARCCOSarccos(expressi on)ARCCOTarccot(x,y)例如 arccot(sqrt(2)/2,sqrt(2)/2) 为 pi/4arccot(-sqrt(2)/2,sqrt(2)/2) 为 3/4 *piarccot(sqrt(2)/2,-sqrt(2)/2) 为-pi/4arccot(-sqrt(2)/2,-sqrt(2)/2) 为-3/4 *pi.ARCTANarcta n( y,x)Program Control用布尔值控制=EqualTrue if the compared items are equal/=Not EqualTrue if the compared items are not equal!=Not EqualTrue if the compared items are not equal>Greater ThanTrue if the expression on the left is greater than the expressi on on the right
Clear_C on sole一个过程,用于清除控制台显示,并将光标移至初始位置关于Raptor 图默认色为白色程序可使用下列函数在窗口中输出 raptor图RaptorGraph 坐标用Ope n Graph Win doW丁开Rap tor Graph后,白色背景中将出现一个打开 的windowwindow左下角像素的坐标为(1,1)Open_Graph_Wi ndow(400,300) 显示的窗口:■ RAPTORGraphDrawi ng Operati ons 画图操作可以绘制指定颜色的指定形状Keyboard Operatio ns 键盘操作用于确定是否有键输入例如输入字符串 ASCII编码Mouse Operations 鼠标操作可以返回当前鼠标位置Window Operations 窗口操作用于更新和设置窗口属性 Freeze Graph Windowand Update Graph Window 调用可以平滑动画显示注:窗口必须打开才能进行相应操作,否则将出现 run-time errorWindow Operatio ns 窗口操作Close_Graph_Wi ndowClose_Graph_Wi ndow关闭窗口过程例:Close_Graph_WindowGet_Max_Heightvariable <- Get_Max_Height返回窗口的高度像素值。
事实上,该过程常在 Open_Graph_Wi ndowi用前使用其值可用来作为打开窗口的参数Open_Graph_Wi ndow(Get_Max_Width,Get_Max_Height)y — Get_Max_HeightGet_Max_Widthvariable <- Get_Max_Width 类同上Get Win dow Height variable <- Get_Wi ndow_Height 返回窗口高度图窗口必须先打开y — GetWindowHeight例: IGet Win dow Widthvariable <- Get_Wi ndow_Width类同上ls_Ope nls_Ope n用于判断窗口是否打开,返回值为 Yes (True)或No (False)常用于判断Open_Graph_Wi ndowOpen_Graph_Wi ndow(X_Size, Y_Size)例:Open_Graph_Window(500, 300)ope ns a 500 pixel (wide) by 300 pixel (high) graphics win dow.Set_Wi ndow_TitleSet_Wi ndow_Title(Title)改变或设置窗口标题。
例:Set_Window_Title("CS 110 PEX 3")Smooth ing An imatio ns 平滑绘制图形Freeze_Graph_Window及 Update_Graph_Window常用于平滑动画显示 不用Freeze_Graph_Window将使每次描画变得明显而导致动画很愣Freeze_Graph_Wi ndow is called (and before Un freeze_Graph_Wi ndow is called), this buffer is used for all graphics calls. That is, theobjects being drawn by the graphics calls are not drawn to the screen, but in stead to the scree n buffer. Whe n the programmer has draw n thedesired objects to the screen buffer, the Update_Graph_Windowcall is used to almost instantaneously movethe screen buffer to the viewable graphicsscree n. An ani mati on n ormall。

卡西欧5800p使用说明书资料.ppt
锂金属电池界面稳定化-全面剖析.docx
SG3525斩控式单相交流调压电路设计要点.doc
话剧《枕头人》剧本.docx
重视家风建设全面从严治党治家应成为领导干部必修课PPT模板.pptx
黄渤海区拖网渔具综合调查分析.docx
2024年一级造价工程师考试《建设工程技术与计量(交通运输工程)-公路篇》真题及答案.docx
【课件】Unit+3+Reading+and+Thinking公开课课件人教版(2019)必修第一册.pptx
嵌入式软件开发流程566841551.doc
生命密码PPT课件.ppt
爱与责任-师德之魂.ppt
制冷空调装置自动控制技术讲义.ppt


