阿摩線上測驗 登入

申論題資訊

試卷:110年 - 110 國立政治大學_碩士班招生考試_數位內容碩士學位學程/資訊應用組:計算機概論與程式設計#102930
科目:研究所、轉學考(插大)◆計算機概論與程式設計
年份:110年
排序:0

題組內容

Please answer the following questions. For answers in code, any programming language (but not mixed) or pseudocode is allowed.(60%)

申論題內容


1. There are two objects, a circle and a square, moving in a 2D game. The center position (cx, cy) and the radius r of the circle are known. The upper-left point (sx, sy) and the edge length e of the square are known. Please define a collision detection function "collidetec" with six float parameters (cx, xy, I sx, sy, e) as mentioned above and a boolean return value to detect whether the collision is between these two objects. Notably, the objects are only moving but not rotating. Furthermore, the power function (次方) is the only function allowed to be used without defining it. Please also brietly describe your code, pseudocode and algorithm. (20%)