Rect
2016-12-08 21:41:02 0 举报
Rect是一个简单的2D矩形类,通常用于计算机图形学和游戏开发中。它包含左上角和右下角的坐标点,可以通过这些坐标来定义矩形的位置和大小。Rect还提供了一些基本的方法,如计算面积、周长、重叠等。在计算机图形学中,Rect可以用于碰撞检测、裁剪和渲染等任务。在游戏开发中,Rect可以用于表示游戏中的墙壁、障碍物、角色等对象。总之,Rect是一个简单而实用的工具,可以帮助开发者处理各种与矩形相关的计算和操作。
作者其他创作
大纲/内容
矩形类 Rectangle属性: 宽度 width:____ 高度 height:____方法: 获取面积 getArea() 获取宽度 getWidth() 获取高度 getHeight()
类
+ attribute1:type = defaultValue+ attribute2:type- attribute3:type
+ operation1(params):returnType- operation2(params)- operation3()
rect2width = 3height = 6
rect1width = 10height = 25
接口
rect3width = 12height = 2
0 条评论
下一页