编程介的小学生 2019-12-21 12:15 采纳率: 20.5%
浏览 78

Rotating a Frame 编写具体的过程

Problem Description
Suppose you have an ice hockey ball (Which has the shape of a cylinder as shown in the figure) and a photo frame (a rectangle). You place the ball in one corner of the photo frame and keep the balls position and orientation fixed. Now you start rotating the frame in clockwise direction. But as the sides of the frame and of the ball have high friction so while the frame is rotating its surface and the balls surface never slips. So the frame always has a constant angular velocity as well as a tangential velocity as shown in the figure below.

Write a program to find the position of the frame after certain time.

Input
he input contains several test cases. Each set of input is contained in two lines. The first line of a set contains eight integers which denote the values x1, y1, x2, y2, x3, y3 and x4, y4 respectively. These values indicate that the four vertices of the frame in clockwise order are denoted by the Cartesian coordinates P1 (x1, y1) , P2 (x2, y2) , P3 (x3, y3) and P4 (x4, y4) . You can assume that 0<=| x1|,| y1|,| x2|,| y2|,| x3|,| y3|,| x4|,| y4|<=1000 . The second line contains three floating point numbers which denotes the values of R (0 < R < 1000) , T (0<=T < 100000) and (0<= < 360) respectively. Here R is the radius of the ice hockey ball, T denotes that we want to know the position of the frame after T seconds and is the angular velocity of the frame in degree/second. You can assume that ball is placed touching two the si! des that intersect at point (x1, y1) and it never moves from or rotates in that position. There will be no such input where the hockey ball cannot be placed within the frame. The last test case is followed by a single zero, which should not be processed.

Output
For each test case, print the case number and eight floating point numbers x1f, y1f, x2f, y2f, x3f, y3f, x4f and y4f , to three decimal places. These floating-point numbers actually denote the final positions of the points (x1, y1),(x2, y2),(x3, y3) and (x4, y4) (The four corners of the frame) respectively after time T seconds.

Sample Input
0 1 1 1 1 0 0 0
0.2 10 0
0 1 1 1 1 0 0 0
0.2 10 100
0

Sample Output
Case 1: 0.000 1.000 1.000 1.000 1.000 0.000 0.000 0.000
Case 2: -0.619 0.132 -0.445 1.117 0.539 0.943 0.366 -0.042

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
    • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
    • ¥20 matlab yalmip kkt 双层优化问题