Bezier Curve

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

<pre>
__ __
Q1*-----------------------*Q2
| _ |
| P(t) |
| . |
| . . |
| . . |
| . . |
__|. .|__
Q0* *Q3

Cubic Bezier curve is defined as:

_ 3__ 2 __ 2__ 3__
P(t) = (1-t) Q0 + 3(1-t) tQ1 + 3(1-t)t Q2 + t Q3 (0 &lt;= t &lt;= 1).

input:
Q0_x
Q0_y
Q1_x
Q1_y
Q2_x
Q2_y
Q3_x
Q3_y

output:
P_x P_y (0 &lt;= t &lt;= 1, step 0.1)

The answer is rounded off and made an integer.
</pre>

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

0
0
-1000
1000
1000
1000
0
0

Sample output:

0 0
-216 270
-288 480
-252 630
-144 720
0 750
144 720
252 630
288 480
216 270
0 0

Sample input:_

0
0
0
1000
1000
0
1000
1000

Sample output:

0 0
28 244
104 392
216 468
352 496
500 500
648 504
784 532
896 608
972 756
1000 1000

Sample input:_

0
0
0
1000
1000
1000
1000
0

Sample output:

0 0
28 270
104 480
216 630
352 720
500 750
648 720
784 630
896 480
972 270
1000 0

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid950.05892012/02/19 05:54:160B / 42B / 50B
2clock1090.10552012/02/15 01:33:550B / 50B / 54B
3yvl1790.09772012/02/05 14:49:350B / 88B / 88B

Perl _

RankUserSizeTimeDateStatistics
1teebee980.05362012/02/18 19:35:510B / 28B / 68B
2tails1170.06682012/02/16 07:11:000B / 40B / 73B

Python _

RankUserSizeTimeDateStatistics
1leonid1100.07592012/02/19 05:53:360B / 53B / 56B
2hallvabo1300.11532012/02/07 08:41:530B / 58B / 70B
3twobit1310.09322012/02/05 23:22:100B / 64B / 61B

PHP _

RankUserSizeTimeDateStatistics
1teebee1230.12992012/02/19 06:33:012B / 46B / 75B
2clock1380.11202012/02/18 22:40:410B / 60B / 76B

Io _

RankUserSizeTimeDateStatistics
1pooq1710.26372012/02/07 05:49:570B / 98B / 66B

JavaScript _

RankUserSizeTimeDateStatistics
1nn1170.05882012/02/16 01:40:560B / 60B / 56B
2clock1310.06422012/02/18 22:19:570B / 64B / 67B

Lua _

RankUserSizeTimeDateStatistics
1pooq1610.07752012/02/18 01:38:480B / 86B / 61B
2Hendrik1610.05112012/02/18 20:23:470B / 84B / 73B
3twobit(pooq)1500.05972012/02/19 23:25:160B / 81B / 55B
4twobit(Hendrik)1530.04422012/02/19 23:25:430B / 78B / 70B

Xtal _

RankUserSizeTimeDateStatistics
1teebee1410.08982012/02/19 02:57:280B / 74B / 62B
2pooq1580.08462012/02/18 23:29:510B / 82B / 73B
3teebee(pooq)1400.06582012/02/19 07:22:010B / 72B / 64B

BASIC _

RankUserSizeTimeDateStatistics
1pooq1350.12142012/02/07 07:20:010B / 80B / 43B

J _

RankUserSizeTimeDateStatistics
1I., S.(formula, cheat)630.11542012/02/16 07:04:290B / 24B / 35B
2I., S.(recurs intern div, cheat)630.09142012/02/16 07:06:000B / 25B / 35B
3I., S.(formula in the descr)670.16482012/02/16 07:02:450B / 27B / 36B
4I., S.680.17412012/02/06 20:10:000B / 28B / 38B

C _

RankUserSizeTimeDateStatistics
1ush1290.04312012/02/16 23:05:500B / 59B / 70B
2inaniwa1290.04372012/02/17 08:09:470B / 61B / 68B
3nn1330.04752012/02/18 11:57:100B / 62B / 68B
4ush1280.05382012/02/19 09:25:560B / 58B / 70B

Pascal _

RankUserSizeTimeDateStatistics
1*yuko*1900.04162012/02/17 20:46:300B / 110B / 64B

Fortran _

RankUserSizeTimeDateStatistics
1*yuko*1170.05242012/02/15 22:40:070B / 57B / 55B

Maxima _

RankUserSizeTimeDateStatistics
1pooq1290.31832012/02/06 18:41:280B / 64B / 63B

bc _

RankUserSizeTimeDateStatistics
1teebee1180.04592012/02/19 05:55:150B / 56B / 59B

R _

RankUserSizeTimeDateStatistics
1pooq921.09402012/02/06 10:54:170B / 47B / 42B
2pooq910.43582012/10/26 12:53:590B / 48B / 40B

QCL _

RankUserSizeTimeDateStatistics
1pooq2300.05562012/02/18 22:41:370B / 147B / 61B

GolfScript _

RankUserSizeTimeDateStatistics
1tails630.10122012/02/16 02:51:470B / 16B / 46B
2tails (cheat)570.15372012/03/02 13:43:360B / 17B / 39B
3tails580.07442012/02/19 23:53:560B / 15B / 42B

Vim _

RankUserSizeTimeDateStatistics
1clock1290.32852012/02/18 22:45:2613B / 64B / 43B

Groovy _

RankUserSizeTimeDateStatistics
1nn1235.73002012/02/18 12:18:340B / 64B / 56B

Language Ranking_

RankLangUserSizeScore
1GolfScripttails (cheat)5710000
2JI., S.(formula, cheat)639047
3Rpooq916263
4Rubyleonid956000
5Perlteebee985816
6Pythonleonid1105181
7Fortran*yuko*1174871
8JavaScriptnn1174871
9bcteebee1184830
10Groovynn1234634
11PHPteebee1234634
12Cush1284453
13Maximapooq1294418
14Vimclock1294418
15BASICpooq1354222
16Xtalteebee(pooq)1404071
17Luatwobit(pooq)1503800
18Iopooq1713333
19Pascal*yuko*1903000
20QCLpooq2302478

return to the top page