Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: tools/pathops_sorter.htm

Issue 131103009: update pathops to circle sort (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: disable old test that still fails on linux 32 release Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/skia_test.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2
3 <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta charset="utf-8" />
6 <title></title>
7 <div style="height:0">
8
9 <div id="quad1">
10 {{3.13,2.74}, {1.08,4.62}, {3.71,0.94}}
11 {{3.13,2.74}, {7.99,2.75}, {8.27,1.96}}
12 </div>
13
14 <div id="quad2">
15 {{4.838888984361574,4.399276078363981}, {5.947577332875065,2.02910379790342}, {3 .8092258119951885,2.108659563498883}}
16 {{4.838888984361574,4.399276078363981}, {6.192910293864926,1.7797920604914939}, {3.3638348513490293,1.4969462106891218}}
17 </div>
18
19 <div id="quad3">
20 {{4.838888984361574,4.399276078363981}, {5.962263714769107,1.654601059605365}, { 3.8789861259918847,2.8650082310420126}}
21 {{4.838888984361574,4.399276078363981}, {6.192910293864926,1.7797920604914939}, {3.3638348513490293,1.4969462106891218}}
22 </div>
23
24 <div id="quad4">
25 {{4.838888984361574,4.399276078363981}, {5.77868394109359,1.852867215174923}, {3 .915702080726988,2.1820914729690903}}
26 {{4.838888984361574,4.399276078363981}, {6.681232491841801,2.5287975370876032}, {3.3638348513490293,1.4969462106891218}}
27 </div>
28
29 <div id="quad5">
30 {{4.838888984361574,4.399276078363981}, {6.082937568878361,1.9951156645288415}, {3.915702080726988,2.1820914729690903}}
31 {{4.838888984361574,4.399276078363981}, {6.681232491841801,2.5287975370876032}, {3.3638348513490293,1.4969462106891218}}
32 </div>
33
34 <div id="quad6">
35 {{4.898159171592373,4.367665311840888}, {6.695396170263287,1.769888953051804}, { 3.6312051820191513,2.727377195492444}}
36 {{4.898159171592373,4.367665311840888}, {6.961778044734251,2.4813813873029633}, {3.3638348513490293,1.4969462106891218}}
37 </div>
38
39 <div id="quad7">
40 {{4.838888984361574,4.399276078363981}, {3.012741870322956,2.449520433298304}, { 5.140619283496844,2.110967248292131}}
41 {{4.838888984361574,4.399276078363981}, {2.804962246947524,2.232446600933607}, { 6.60393841996606,2.077794045550955}}
42 </div>
43
44 <div id="quad8">
45 {{4.838888984361574,4.399276078363981}, {3.1707957029384213,2.607574265913769}, {4.626944327496585,2.2848264641691425}}
46 {{4.838888984361574,4.399276078363981}, {2.804962246947524,2.232446600933607}, { 6.60393841996606,2.077794045550955}}
47 </div>
48
49 <div id="quad9">
50 {{4.838888984361574,4.399276078363981}, {3.463749932092156,2.935940544745428}, { 5.161344349908893,2.4940794849932386}}
51 {{4.838888984361574,4.399276078363981}, {2.804962246947524,2.232446600933607}, { 6.60393841996606,2.077794045550955}}
52 </div>
53
54 <div id="quad10">
55 {{4.838888984361574,4.399276078363981}, {5.82508561259808,2.495362604119041}, {3 .4377993053488463,2.7132154732530362}}
56 {{4.838888984361574,4.399276078363981}, {6.192910293864926,1.7797920604914939}, {2.435268584733173,1.817005221735438}}
57 </div>
58
59 <div id="cubic1">
60 {{0,0}, {1,0}, {0,1}, {1,1}}
61 {{0,0}, {2,0}, {0,2}, {2,2}}
62 </div>
63
64 <div id="cubic2" >
65 {{0.4655213647959181,1.5608657525510201}, {0.6599868463010203,0.4290098852040817 }, {2.473652742346939,1.2464524872448977}, {1.8511738679846936,0.534478635204081 8}}
66 {{0.4655213647959181,1.5608657525510201}, {0.3250358737244896,0.819226323341837} , {1.4399214764030612,0.3318817761479596}, {1.2703414571528546,0.908146532214418 1}}
67 </div>
68
69 <div id="quad11">
70 {{-378.22698974609375, -987.8935546875}, {-47.53326416015625, 482.7139892578125} , {-626.4708251953125, -338.62969970703125}}
71 {{-378.22698974609375, -987.8935546875}, {-847.94854736328125, -861.422302246093 75}, {-390.9146728515625, 402.08740234375}}
72 </div>
73
74 <div id="quad12">
75 {{-173.3448486328125, -962.89422607421875}, {-778.321533203125, -161.47637939453 125}, {-196.77374267578125, -736.40155029296875}}
76 {{-173.3448486328125, -962.89422607421875}, {652.3017578125, -400.67816162109375 }, {-386.7855224609375, 361.1614990234375}}
77 </div>
78
79 <div id="quad13">
80 {{{-968.181396484375, 544.0128173828125}, {592.2825927734375, 870.552490234375}, {593.435302734375, 557.8828125}}}
81 {{{-968.181396484375, 544.0128173828125}, {593.677001953125, 865.5810546875}, {- 66.57171630859375, -847.849853515625}}}
82 </div>
83
84 <div id="quad14">
85 {{{769.693115234375, -626.35089111328125}, {6.60491943359375, -210.4375610351562 5}, {-898.26654052734375, -17.76312255859375}}}
86 {{{769.693115234375, -626.35089111328125}, {192.8486328125, 609.8062744140625}, {888.317626953125, -551.27215576171875}}}
87 </div>
88
89 <div id="quad15">
90 {{{187.410400390625, -343.557373046875}, {-752.7930908203125, 431.57177734375}, {387.663330078125, 701.281982421875}}}
91 {{{187.410400390625, -343.557373046875}, {-86.16302490234375, -366.027099609375} , {-468.3883056640625, -25.736572265625}}}
92 </div>
93
94 <div id="quad16">
95 {{{-353.9388427734375, 76.8973388671875}, {-36.00189208984375, 282.289306640625} , {-531.37969970703125, 683.95751953125}}}
96 {{{-353.9388427734375, 76.8973388671875}, {-779.3529052734375, 509.6165771484375 }, {-662.34088134765625, 124.4027099609375}}}
97 </div>
98
99 <div id="quad17">
100 {{{-657.0289306640625, 681.611083984375}, {-991.8365478515625, 964.4644775390625 }, {-843.3585205078125, 904.47998046875}}}
101 {{{-657.0289306640625, 681.611083984375}, {-763.1571044921875, 39.1097412109375} , {618.2041015625, 840.6429443359375}}}
102 </div>
103
104 <div id="quad18">
105 {{{-609.406005859375, -684.37506103515625}, {766.4923095703125, 583.657958984375 }, {-912.6832275390625, -949.553466796875}}}
106 {{{-609.406005859375, -684.37506103515625}, {774.140380859375, 82.2415771484375} , {540.9007568359375, -136.982666015625}}}
107 </div>
108
109 <div id="quad19">
110 {{{-657.0289306640625, 681.611083984375}, {-991.8365478515625, 964.4644775390625 }, {-843.3585205078125, 904.47998046875}}}
111 {{{-657.0289306640625, 681.611083984375}, {-763.1571044921875, 39.1097412109375} , {618.2041015625, 840.6429443359375}}}
112 </div>
113
114 <div id="quad20">
115 {{{123.2955322265625, -577.799560546875}, {-491.892578125, 704.91748046875}, {47 8.03759765625, -951.92333984375}}}
116 {{{123.2955322265625, -577.799560546875}, {-550.6966552734375, 812.216796875}, { -816.3184814453125, -705.0025634765625}}}
117 </div>
118
119 <div id="quad21">
120 {{{123.2955322265625, -577.799560546875}, {-481.892578125, 704.91748046875}, {47 8.03759765625, -951.92333984375}}}
121 {{{123.2955322265625, -577.799560546875}, {-550.6966552734375, 812.216796875}, { -816.3184814453125, -705.0025634765625}}}
122 </div>
123
124 <div id="quad22">
125 {{{187.410400390625, -343.557373046875}, {-752.7930908203125, 431.57177734375}, {387.663330078125, 701.281982421875}}}
126 {{{187.410400390625, -343.557373046875}, {-86.16302490234375, -366.027099609375} , {-468.3883056640625, -25.736572265625}}}
127 </div>
128
129 <div id="quad23">
130 {{{-341.26922607421875, 964.1964111328125}, {883.2567138671875, 812.730102539062 5}, {286.0372314453125, 94.979248046875}}}
131 {{{-341.26922607421875, 964.1964111328125}, {-158.90765380859375, 597.1875}, {-2 82.2255859375, 262.430908203125}}}
132 </div>
133
134 <div id="quad24">
135 {{{123.2955322265625, -577.799560546875}, {-481.892578125, 704.91748046875}, {47 8.03759765625, -951.92333984375}}}
136 {{{123.2955322265625, -577.799560546875}, {-550.6966552734375, 812.216796875}, { -816.3184814453125, -705.0025634765625}}}
137 {{{417.3499131065152, -577.799560546875}, {417.3499131065152, -699.6008748290115 6}, {331.22337542585541, -785.72740374616797}}}
138 </div>
139
140 <div id="quad25">
141 {{{922.6107177734375, 291.412109375}, {-939.361572265625, 589.8492431640625}, {- 515.70941162109375, 120.2764892578125}}}
142 {{{922.6107177734375, 291.412109375}, {148.5115966796875, -751.42095947265625}, {-347.47503662109375, 331.1798095703125}}}
143 {{{922.6107177734375, -143.9114969433939}, {742.29377357777753, -143.91149694339 39}, {614.79044900323777, -16.408159395199732}}}
144 {{{487.2871114550436, 291.412109375}, {487.2871114550436, 471.72905357065997}, { 614.79044900323777, 599.23237814519973}}}
145 </div>
146
147 <div id="quad26">
148 {{{187.410400390625, -343.557373046875}, {-752.7930908203125, 431.57177734375}, {387.663330078125, 701.281982421875}}}
149 {{{187.410400390625, -343.557373046875}, {-86.16302490234375, -366.027099609375} , {-468.3883056640625, -25.736572265625}}}
150 {{{33.221887415632978, -343.557373046875}, {33.221887415632978, -279.69039894717 827}, {78.38265915086852, -234.52963180711851}}}
151 </div>
152
153 <div id="quad27">
154 {{{-173.3448486328125, -962.89422607421875}, {-778.321533203125, -161.4763793945 3125}, {-196.77374267578125, -736.40155029296875}}}
155 {{{-173.3448486328125, -962.89422607421875}, {652.3017578125, -400.6781616210937 5}, {-386.7855224609375, 361.1614990234375}}}
156 {{{-270.84959533883426, -865.38947936819704}, {-230.46180860703427, -825.0016885 2687921}, {-173.3448486328125, -825.00168852687921}}}
157 {{{-75.840101926790737, -865.38947936819704}, {-35.4523110854729, -905.777266099 99695}, {-35.4523110854729, -962.89422607421875}}}
158 </div>
159
160 <div id="quad28">
161 {{{344.2755126953125, -689.900390625}, {743.6728515625, 512.8448486328125}, {928 .598388671875, 111.946044921875}}}
162 {{{344.2755126953125, -689.900390625}, {-950.03106689453125, -511.25741577148437 }, {850.8173828125, 798.4874267578125}}}
163 {{{344.2755126953125, -689.900390625}, {850.8173828125, 798.4874267578125}}}
164 {{{344.2755126953125, -689.900390625}, {391.39917554828793, -551.43545842779145} }}
165 </div>
166
167 <div id="quad29">
168 {{{351.8946533203125, 512.8131103515625}, {-294.22332763671875, 183.220092773437 5}, {624.4842529296875, 862.0753173828125}}}
169 {{{351.8946533203125, 512.8131103515625}, {489.1907958984375, -543.4212646484375 }, {-432.7445068359375, 812.5205078125}}}
170 </div>
171
172 <div id="quad30">
173 {{{627.6910400390625, 81.144287109375}, {168.9248046875, -211.72735595703125}, { -61.57086181640625, 915.171875}}}
174 {{{627.6910400390625, 81.144287109375}, {918.159423828125, -325.468994140625}, { 359.0523681640625, 817.4888916015625}}}
175 {{{235.78221371860315, 81.144287109375}, {235.78221371860315, 243.47824037936314 }, {350.56965608373537, 358.26567106470213}}},
176 </div>
177
178 <div id="quad31">
179 {{{178.1549072265625, 62.724609375}, {541.3643798828125, 223.823486328125}, {-44 6.77471923828125, -15.990478515625}}}
180 {{{178.1549072265625, 62.724609375}, {-347.14031982421875, -834.27191162109375}, {-495.13888549804687, 96.476806640625}}}
181 </div>
182
183 <div id="quad32">
184 {{{-809.41009521484375, 370.4566650390625}, {622.44677734375, -166.97119140625}, {-285.6748046875, 333.81005859375}}},
185 {{{-809.41009521484375, 370.4566650390625}, {-110.36346435546875, -656.960449218 75}, {906.4796142578125, 530.2061767578125}}}
186 </div>
187
188 <div id="quad33">
189 {{{-918.58624267578125, 653.6695556640625}, {-639.37548828125, 61.493896484375}, {-198.9605712890625, 243.704345703125}}},
190 {{{-918.58624267578125, 653.6695556640625}, {-302.093505859375, -107.10955810546 875}, {696.4962158203125, 600.738525390625}}}
191 </div>
192
193 <div id="quad34">
194 {{{-610.4193115234375, 861.173095703125}, {403.3203125, 215.3988037109375}, {-37 3.5546875, 179.88134765625}}},
195 {{{-610.4193115234375, 861.173095703125}, {-757.244140625, -222.137451171875}, { 705.892822265625, 87.4090576171875}}}
196 </div>
197
198 <div id="quad35">
199 {{{282.5767822265625, -529.4022216796875}, {392.0968017578125, 768.1014404296875 }, {712.11572265625, 189.19677734375}}},
200 {{{282.5767822265625, -529.4022216796875}, {699.360595703125, 465.6171875}, {438 .5755615234375, 125.5230712890625}}}
201 </div>
202
203 <div id="quad36">
204 {{{-170.1510009765625, -184.905517578125}, {654.734130859375, 120.339599609375}, {-470.98443603515625, -69.4737548828125}}},
205 {{{-170.1510009765625, -184.905517578125}, {-500.9822998046875, -148.40911865234 375}, {-446.35821533203125, -840.5694580078125}}}
206 </div>
207
208 <div id="quad37">
209 {{{-119.55023193359375, -39.2008056640625}, {-618.14306640625, -620.141967773437 5}, {-779.53790283203125, -681.9923095703125}}},
210 {{{-119.55023193359375, -39.2008056640625}, {365.968994140625, 55.4974365234375} , {98.1297607421875, -192.474609375}}}
211 </div>
212
213 <div id="quad38">
214 {{{607.9136962890625, 484.1448974609375}, {280.619140625, 982.736572265625}, {-5 77.5596923828125, 798.9134521484375}}},
215 {{{607.9136962890625, 484.1448974609375}, {374.318115234375, -590.5146484375}, { -258.30438232421875, 592.958984375}}}
216 </div>
217
218 <div id="quad39">
219 {{{-491.48846435546875, -470.9105224609375}, {109.7149658203125, -989.5384521484 375}, {-275.900390625, 657.1920166015625}}},
220 {{{-491.48846435546875, -470.9105224609375}, {-796.935791015625, 191.326171875}, {-852.120849609375, 62.06005859375}}}
221 </div>
222
223 <div id="quad40">
224 {{{-872.76458740234375, -163.30078125}, {723.6697998046875, 177.8204345703125}, {206.470703125, 147.9564208984375}}},
225 {{{-872.76458740234375, -163.30078125}, {556.937744140625, 715.4345703125}, {627 .348388671875, 77.0643310546875}}}
226 </div>
227
228 <div id="quad108">
229 {{{282.5767822265625, -529.4022216796875}, {392.0968017578125, 768.1014404296875 }, {712.11572265625, 189.19677734375}}},
230 {{{282.5767822265625, -529.4022216796875}, {699.360595703125, 465.6171875}, {438 .5755615234375, 125.5230712890625}}}
231 </div>
232
233 <div id="quad159">
234 {{{-868.3076171875, -212.74591064453125}, {-208.84014892578125, -57.353515625}, {393.79736328125, -986.03607177734375}}},
235 {{{-868.3076171875, -212.74591064453125}, {371.0980224609375, -960.9017333984375 }, {-236.2821044921875, -441.20074462890625}}}
236 </div>
237
238 <div id="quad212">
239 {{{-610.4193115234375, 861.173095703125}, {403.3203125, 215.3988037109375}, {-37 3.5546875, 179.88134765625}}},
240 {{{-610.4193115234375, 861.173095703125}, {-757.244140625, -222.137451171875}, { 705.892822265625, 87.4090576171875}}}
241 </div>
242
243 <div id="quad232">
244 {{{766.497802734375, 675.660400390625}, {639.0235595703125, 351.4776611328125}, {345.9315185546875, 624.685791015625}}},
245 {{{766.497802734375, 675.660400390625}, {-901.72650146484375, 923.99169921875}, {755.665283203125, 416.728759765625}}}
246 </div>
247
248 <div id="quad379">
249 {{{-872.76458740234375, -163.30078125}, {723.6697998046875, 177.8204345703125}, {206.470703125, 147.9564208984375}}},
250 {{{-872.76458740234375, -163.30078125}, {556.937744140625, 715.4345703125}, {627 .348388671875, 77.0643310546875}}}
251 </div>
252
253 <div id="quad413">
254 {{{-127.60784912109375, 384.614990234375}, {-184.46685791015625, 717.57287597656 25}, {-981.56524658203125, -827.18109130859375}}},
255 {{{-127.60784912109375, 384.614990234375}, {-125.78131103515625, 751.18774414062 5}, {562.529541015625, -277.5535888671875}}}
256 </div>
257
258 <div id="quad179">
259 {{{-595.956298828125, -113.24383544921875}, {-730.611572265625, 481.532348632812 5}, {505.58447265625, -504.9130859375}}},
260 {{{-595.956298828125, -113.24383544921875}, {-971.0836181640625, -849.7390747070 3125}, {-32.39227294921875, -906.3277587890625}}}
261 </div>
262
263 <div id="quad584">
264 {{{-406.65435791015625, 599.96630859375}, {-566.71881103515625, -400.65362548828 125}, {-486.0682373046875, 100.34326171875}}},
265 {{{-406.65435791015625, 599.96630859375}, {799.783935546875, 992.77783203125}, { 180.6688232421875, -490.0054931640625}}}
266 </div>
267
268 <div id="quad653">
269 {{{-46.6143798828125, 164.224853515625}, {-161.7724609375, 327.61376953125}, {16 8.5106201171875, -948.4150390625}}},
270 {{{-46.6143798828125, 164.224853515625}, {412.9364013671875, -199.26715087890625 }, {-278.044677734375, 472.3961181640625}}}
271 </div>
272
273 <div id="quad809">
274 {{{-176.8541259765625, -275.9761962890625}, {-723.969482421875, -7.4718017578125 }, {931.6959228515625, 231.6737060546875}}},
275 {{{-176.8541259765625, -275.9761962890625}, {-250.86737060546875, -748.814331054 6875}, {-96.77099609375, -287.76336669921875}}}
276 </div>
277
278 <div id="quad14a">
279 {{{-609.406005859375, -684.37506103515625}, {766.4923095703125, 583.657958984375 }, {-912.6832275390625, -949.553466796875}}},
280 {{{-609.406005859375, -684.37506103515625}, {774.140380859375, 82.2415771484375} , {540.9007568359375, -136.982666015625}}}
281 </div>
282
283 <div id="quad22a">
284 {{{-728.5626220703125, 141.134521484375}, {749.9122314453125, -645.93359375}, {6 7.1751708984375, -285.85528564453125}}},
285 {{{-728.5626220703125, 141.134521484375}, {-841.0341796875, -988.058349609375}, {34.87939453125, -489.359130859375}}}
286 {{{276.48354206343231, -395.24293552482953}, {-728.5626220703125, 141.1345214843 75}}}
287 {{{fX=97.702285839737073, -301.95147049201717}, {-728.5626220703125, 141.1345214 84375}}}
288 {{{fX=-52.525628917174856, -536.31069276053427}, {-728.5626220703125, 141.134521 484375}}}
289 {{{fX=-5.2463328209585285, -511.63085965304060}, {-728.5626220703125, 141.134521 484375}}}
290 </div>
291
292 <div id="quad77">
293 {{{383.7933349609375, -397.5057373046875}, {480.7408447265625, 92.927490234375}, {690.7930908203125, -267.44964599609375}}},
294 {{{383.7933349609375, -397.5057373046875}, {83.3685302734375, 619.781005859375}, {688.14111328125, 416.241455078125}}}
295 </div>
296
297 <div id="quad94">
298 {{{627.6910400390625, 81.144287109375}, {168.9248046875, -211.72735595703125}, { -61.57086181640625, 915.171875}}},
299 {{{627.6910400390625, 81.144287109375}, {918.159423828125, -325.468994140625}, { 359.0523681640625, 817.4888916015625}}}
300 {{{564.43435948662466, 47.034527772832369}, {627.6910400390625, 81.144287109375} }}
301 {{{699.34014109378302, 79.147174806567705}, {627.6910400390625, 81.144287109375} }}
302 </div>
303
304 <div id="quad4a">
305 {{{187.410400390625, -343.557373046875}, {-752.7930908203125, 431.57177734375}, {387.663330078125, 701.281982421875}}},
306 {{{187.410400390625, -343.557373046875}, {-86.16302490234375, -366.027099609375} , {-468.3883056640625, -25.736572265625}}}
307 </div>
308
309 <div id="quad0">
310 {{{-708.0077926931004413, -154.6166947224404566}, {-701.0429781735874712, -128.8 517387364408933}, {505.58447265625, -504.9130859375}}},
311 {{{-708.0077926931004413, -154.6166947224404566}, {-721.5125661899801344, -174.4 028951148648048}, {-32.39227294921875, -906.3277587890625}}}
312 {{{-707.8363172079705237, -154.25350453766481}, {-708.0077926931004413, -154.616 6947224404566}}}
313 {{{-708.1792267111628689, -154.9799046892118213}, {-708.0077926931004413, -154.6 166947224404566}}}
314 </div>
315
316 <div id="quad999">
317 {{{-708.00779269310044, -154.61669472244046}, {-707.92342686353186, -154.3045999 9551294}, {505.58447265625, -504.9130859375}}},
318 {{{-708.00779269310044, -154.61669472244046}, {-708.1713780141481, -154.85636789 757655}, {-32.39227294921875, -906.3277587890625}}}
319 {{{-708.0077672218041, -154.61664072892336}, {-708.00779269310044, -154.61669472 244046}}}
320 {{{-708.00781827681976, -154.61674895426012}, {-708.00779269310044, -154.6166947 2244046}}}
321 </div>
322
323 <div id="quad113">
324 {{{425.018310546875, -866.61865234375}, {-918.76531982421875, 209.05322265625}, {964.34716796875, 199.52587890625}}},
325 {{{425.018310546875, -866.61865234375}, {703.10693359375, -955.0738525390625}, { -952.24664306640625, -717.94775390625}}}
326 </div>
327
328 <div id="quad136">
329 {{{178.1549072265625, 62.724609375}, {541.3643798828125, 223.823486328125}, {-44 6.77471923828125, -15.990478515625}}},
330 {{{178.1549072265625, 62.724609375}, {-347.14031982421875, -834.27191162109375}, {-495.138885498046875, 96.476806640625}}}
331 </div>
332
333 <div id="quad206">
334 {{{-503.007415771484375, -318.59490966796875}, {-798.330810546875, -881.21630859 375}, {-127.2027587890625, 769.6160888671875}}},
335 {{{-503.007415771484375, -318.59490966796875}, {-153.6217041015625, -776.8967285 15625}, {-378.43701171875, -296.3197021484375}}}
336 {{{-468.9176053311167607, -89.39573455985038208}, {-503.007415771484375, -318.59 490966796875}}}
337 {{{-356.1573846604815685, -497.6768266540607328}, {-503.007415771484375, -318.59 490966796875}}}
338 {{{-559.0376987487186398, -420.2054253473417589}, {-503.007415771484375, -318.59 490966796875}}}
339 {{{-431.6586315464865606, -409.8353728177644371}, {-503.007415771484375, -318.59 490966796875}}}
340 </div>
341
342 <div id="quad640">
343 {{{412.260498046875, 49.193603515625}, {838.97900390625, 86.9951171875}, {427.78 96728515625, -605.6881103515625}}},
344 {{{412.260498046875, 49.193603515625}, {-995.54583740234375, 990.032470703125}, {-881.18670654296875, 461.211669921875}}}
345 </div>
346
347 <div id="quad3160">
348 {{{426.645751953125, 813.79150390625}, {-387.23828125, -588.89483642578125}, {79 2.4261474609375, -704.4637451171875}}},
349 {{{426.645751953125, 813.79150390625}, {19.24896240234375, -416.09906005859375}, {233.8497314453125, 350.778564453125}}}
350 </div>
351
352 <div id="quad35237">
353 {{{-770.8492431640625, 948.2369384765625}, {-853.37066650390625, 972.03015136718 75}, {-200.62042236328125, -26.7174072265625}}},
354 {{{-770.8492431640625, 948.2369384765625}, {513.602783203125, 578.8681640625}, { 960.641357421875, -813.69757080078125}}}
355 </div>
356
357 <div id="quad37226">
358 {{{563.8267822265625, -107.4566650390625}, {-44.67724609375, -136.57452392578125 }, {492.3856201171875, -268.79644775390625}}},
359 {{{563.8267822265625, -107.4566650390625}, {708.049072265625, -100.7778930664062 5}, {-48.88226318359375, 967.9022216796875}}}
360 </div>
361
362 <div id="quad67242">
363 {{{598.857421875, 846.345458984375}, {-644.095703125, -316.12921142578125}, {-97 .64599609375, 20.6158447265625}}},
364 {{{598.857421875, 846.345458984375}, {715.7142333984375, 955.3599853515625}, {-9 19.9478759765625, 691.611328125}}}
365 </div>
366
367 <div id="quad208">
368 {{{481.1463623046875, -687.09613037109375}, {643.64697265625, -951.9462890625}, {162.5869140625, 698.7342529296875}}},
369 {{{481.1463623046875, -687.09613037109375}, {171.8175048828125, -919.07977294921 875}, {153.3433837890625, -587.43072509765625}}}
370 </div>
371
372 <div id="quad8a">
373 {{{344.2755126953125, -689.900390625}, {743.6728515625, 512.8448486328125}, {928 .598388671875, 111.946044921875}}},
374 {{{344.2755126953125, -689.900390625}, {-950.03106689453125, -511.25741577148437 }, {850.8173828125, 798.4874267578125}}}
375 </div>
376
377 <div id="quad8b">
378 {{{344.2755126953125, -689.900390625}, {928.598388671875, 111.946044921875}, {74 3.6728515625, 512.8448486328125}}},
379 {{{344.2755126953125, -689.900390625}, {-950.03106689453125, -511.25741577148437 }, {850.8173828125, 798.4874267578125}}}
380 </div>
381
382 <div id="quad8741">
383 {{{944.9024658203125, 939.454345703125}, {-971.06219482421875, -914.243957519531 25}, {-878.764404296875, -297.61602783203125}}},
384 {{{944.9024658203125, 939.454345703125}, {-838.96612548828125, -785.837646484375 }, {-126.80029296875, 921.1981201171875}}}
385 {{{107.03238931174118, 218.460612766889}, {944.9024658203125, 939.454345703125}} }
386 {{{-292.72752350740279, 99.917575976335598}, {944.9024658203125, 939.45434570312 5}}}
387 </div>
388
389 <div id="quad89987">
390 {{{939.4808349609375, 914.355224609375}, {-357.7921142578125, 590.842529296875}, {736.8936767578125, -350.717529296875}}},
391 {{{939.4808349609375, 914.355224609375}, {-182.85418701171875, 634.4552001953125 }, {-509.62615966796875, 576.1182861328125}}}
392 </div>
393
394 <div id="simplifyQuadratic36">
395 {{{1.9474306106567383, 2.3777823448181152}, {1.9234547048814592, 2.2418855043499 213}, {1.8885438442230225, 2.1114561557769775}}}
396 {{{1.9474306106567383, 2.3777823448181152}, {2.0764266380046235, 2.2048800651418 379}, {1.8888888359069824, 2.1111111640930176}}}
397 </div>
398
399 <div id="simplifyQuadratic58">
400 {{326.236786,205.854996}, {329.104431,231.663818}, {351.512085,231.663818}}
401 {{303.12088,141.299606}, {330.463562,217.659027}}
402 </div>
403
404 <div id="simplifyQuadratic58a">
405 {{{326.23678588867188, 205.85499572753906}, {328.04376176056422, 222.11778818951 981}, {337.6092529296875, 228.13298034667969}
406 {{{303.12088012695312, 141.29960632324219}, {330.46356201171875, 217.65902709960 937}
407 </div>
408
409 <div id="quadratic58again">
410 {{322.935669,231.030273}, {312.832214,220.393295}, {312.832214,203.454178}}
411 {{322.12738,233.397751}, {295.718353,159.505829}}
412 </div>
413
414 <div id="simplifyQuadratic56">
415 {{{380.29449462890625, 140.44486999511719}, {387.29080200195312, 136.67460632324 219}, {396.0399169921875, 136.67460632324219}}}
416 {{{380.29449462890625, 140.44486999511719}, {388.29925537109375, 136.67460632324 219}, {398.16494750976562, 136.67460632324219}}}
417 {{{380.29449462890625, 140.44486999511719}, {387.692810, 137.858429}}}
418 </div>
419
420 <div id="simplifyQuadratic56a">
421 {{{380.29449462890625, 140.44486999511719}, {387.29079954793264, 136.67460632324 219}, {396.0399169921875, 136.67460632324219}}}
422 {{{380.29449462890625, 140.44486999511719}, {388.29925767018653, 136.67460632324 219}, {398.16494750976562, 136.67460632324219}}}
423 {{fX=380.29449462890625 fY=140.44486999511719 }, {fX=398.16494750976562 fY=136.6 7460632324219 }} }
424 {{fX=380.29449462890625 fY=140.44486999511719 }, {fX=396.03991699218750 fY=136.6 7460632324219 }}
425 </div>
426
427 <div id="simplifyQuadratic27">
428 {{{1, 1}, {1, 0.666666687f}, {0.888888896f, 0.444444448f}}}
429 {{{1, 1}, {1, 0.5f}, {0, 0}}}
430 {{fX=1.0000000000000000 fY=1.0000000000000000 }, {fX=0.00000000000000000 fY=0.00 000000000000000 }} }
431 {{fX=1.0000000000000000 fY=1.0000000000000000 }, {fX=0.88888889551162720 fY=0.44 444444775581360 }} }
432 </div>
433
434 <div id="cubicOp7d">
435 {{{0.7114982008934021, 1.6617077589035034}, {0.51239079236984253, 1.495265722274 7803}, {0.27760171890258789, 1.2776017189025879}, {0, 1}}}
436 {{{0.7114982008934021, 1.6617077589035034}, {0.20600014925003052, 1.785488843917 8467}, {9.8686491813063348e-017, 1.9077447652816772}, {0, 1}}}
437 </div>
438
439 <div id="cubicOp25i">
440 {{{3.3856770992279053, 1.6298094987869263}, {3.777235186270762, 1.27447162372771 14}, {3.7191683314895783, 1.4127666421509713}, {3.3995792865753174, 1.6371387243 270874}}}
441 {{{3.3856770992279053, 1.6298094987869263}, {3.3902986605112582, 1.6322361865810 757}, {3.3949326825525121, 1.6346792563210237}, {3.3995792865753174, 1.637138724 3270874}}}
442 {{3.3856770992279053, 1.6298094987869263 }, {3.3995792865753174, 1.6371387243270 874 }}
443 </div>
444
445 <div id="eldorado1">
446 {{{1006.69513f, 291}, {1023.26367f, 291}, {1033.84021f, 304.431458f}, {1030.3183 6f, 321}}}
447 {{{1030.318359375, 321}, {1036.695068359375, 291}}}
448 {{fX=1030.3183593750000 fY=321.00000000000000 }, {fX=1006.6951293945312 fY=291.0 0000000000000 }} }
449 </div>
450
451 <div id="carpetplanet1">
452 {{fX=67.000000000000000, 913.00000000000000 }, {194.00000000000000, 1041.0000000 000000 }} }
453 {{fX=67.000000000000000, 913.00000000000000 }, {67.662002563476562, 926.00000000 000000 }} }
454 {{{67, 913}, {67, 917.388977f}, {67.223999f, 921.726013f}, {67.6620026f, 926}}}
455 {{{67, 913}, {67, 983.692017f}, {123.860001f, 1041}, {194, 1041}}}
456 {{{67, 913}, {67.17070902440698, 919.69443917507760}}}
457 </div>
458
459 <div id="cubicOp104">
460 {{{2.25, 2.5}, {4.5, 1}}}
461 {{{2.25, 2.5}, {3.0833333333333321, 1.9999999999999973}, {4.0277778307596899, 1. 2777777777777759}, {4.8611111640930176, 1}}}
462 {{{2.25, 2.5}, {1.9476099234472042, 2.6814340459316774}, {1.6598502000264239, 2. 8336073904096661}, {1.3973386287689209, 2.9246666431427002}}}
463 {{{2.25, 2.5}, {1.2674896717071533, 3.1550068855285645}}}
464 </div>
465
466 <div id="cubicOp105">
467 {{{2.4060275554656982, 3.4971563816070557}, {2.9702522134213849, 4.2195279679982 622}, {3.8172613958721247, 5.0538091166976979}, {5, 6}}}
468 {{{2.4060275554656982, 3.4971563816070557}, {3.4194286958002023, 3.5574883660881 684}, {4.0077197935900575, 2.6628073781813661}, {2.2602717876434326, 0.335456222 29576111}}}
469 </div>
470
471 <div id="cubicOp106">
472 {{{0.80825299024581909, 1.9691258668899536}, {0.8601454496383667, 1.988554120063 7817}, {0.92434978485107422, 2}, {1, 2}}}
473 {{{0.80825299024581909, 1.9691258668899536}, {2.2400102615356445, 3.596683740615 8447}, {2.5486805438995361, 3.362929105758667}, {2.494147777557373, 2.5976591110 229492}}}
474 {{{0.80825299024581909, 1.9691258668899536}, {2.494147777557373, 2.5976591110229 492}}}
475 {{{0.80825299024581909, 1.9691258668899536}, {1, 2}}}
476 </div>
477
478 <div id="cubicOp109">
479 {{{5, 4}, {5.443139240552143931, 3.556860759447856069}, {5.297161243696338673, 3 .702838775882067335}, {4.649086475372314453, 3.654751062393188477}}}
480 {{{5, 4}, {4.876459521889748849, 3.876459521889748849}, {4.759596556247283949, 3 .761504502886134915}, {4.649086475372314453, 3.654751062393188477}}}
481 </div>
482
483 <div id="skpwww_joomla_org_23">
484 {{{421, 378}, {421, 380.209137f}, {418.761414f, 382}, {416, 382}}}
485 {{{320, 378}, {421, 378.000031f}}}
486 {{{421, 378.000031f}, {421, 383}}}
487 {{{416, 383}, {418.761414f, 383}, {421, 380.761414f}, {421, 378}}}
488 </div>
489
490 <div id="xop1i">
491 {{5.000,1.000}, {5.191,0.809}, {5.163,0.837}, {4.993,1.000}}
492 {{5.000,1.000}, {4.968,1.024}}
493 {{5.000,1.000}, {4.998,1.000}, {4.995,1.000}, {4.993,1.000}}
494 </div>
495
496 <div id="xop1u">
497 {{3.500,3.500}, {3.000,4.000}, {2.500,4.500}, {1.000,4.000}}
498 {{3.500,3.500}, {3.113,3.887}, {2.725,4.275}, {2.338,3.732}}
499 </div>
500
501 <div id="xOp2i">
502 {{{2, 3}, {1.3475509011665685, 4.9573472965002949}, {2.8235509286078759, 3.50917 59365574173}, {3.6505906581878662, 1.9883773326873779}}}
503 {{{2, 3}, {2.4604574005585795, 2.654656949581065}, {3.0269255632437986, 2.309313 7214344743}, {3.6505906581878662, 1.9883773326873779}}}
504 {{{2, 3}, {1.0000000000000013, 3.7500000000000004}, {0.500000000000001, 4.5}, {1 , 5}}}
505 </div>
506
507 <div id="testQuadratic56">
508 {{{380.29449462890625, 140.44486999511719}, {379.59701460635523, 140.82073748821 79}, {378.91729736328125, 141.23385620117187}}}
509 {{{380.29449462890625, 140.44486999511719}, {387.29079954793264, 136.67460632324 219}, {396.0399169921875, 136.67460632324219}}}
510 {{{380.29449462890625, 140.44486999511719}, {388.29925767018653, 136.67460632324 219}, {398.16494750976562, 136.67460632324219}}}
511 </div>
512
513 <div id="testQuad15">
514 {{{1, 3}, {1, 1}}}
515 {{{1, 3}, {0, 0}}}
516 {{{1, 3}, {2, 0}, {0, 0}}}
517 </div>
518
519 <div id="testQuad21">
520 {{{0, 0}, {1, 1}}}
521 {{{0, 0}, {3, 0}, {2, 3}}}
522 {{{0, 0}, {2, 3}}}
523 {{{0, 0}, {2, 1}}}
524 </div>
525
526 <div id="testQuad22">
527 {{{0, 0}, {1.2000000476837158, 0.80000001192092896}}}
528 {{{0, 0}, {2, 0}}}
529 {{{0, 0}, {0, 1}, {3, 2}}}
530 {{{0, 0}, {1, 1}}}
531 </div>
532
533 <div id="testQuad23">
534 {{{1, 3}, {1.9090908914804459, 1.1818182170391081}, {0.33884298801422119, 1.0165 289640426636}}}
535 {{{1, 3}, {0.33884298801422119, 1.0165289640426636}}}
536 {{{1, 3}, {3, 0}}}
537 </div>
538
539 <div id="cubicOp35d">
540 {{{2.211416482925415, 1.6971458196640015}, {1.2938009262874868, 2.82736192888300 05}, {0.64690048634813535, 3.5876019453925414}, {0, 1}}}
541 {{{2.211416482925415, 1.6971458196640015}, {1.0082962512969971, 1.99792587757110 6}}}
542 {{{2.211416482925415, 1.6971458196640015}, {5, 1}}}
543 </div>
544
545 <div id="skpnational_com_au81">
546 {{{1110.7071533203125, 817.29290771484375}, {1110.9998779296875, 817.58587646484 375}, {1111, 818}}}
547 {{{1110.7071533203125, 817.29290771484375}, {1110.526180767307778, 817.111921450 8684081}, {1110.276144384999725, 817}, {1110, 817}}}
548 {{{1110.7071533203125, 817.29290771484375}, {1110.888097894721341, 817.473866007 1997174}, {1111, 817.7238677851287321}, {1111, 818}}}
549 {{{1110.7071533203125, 817.29290771484375}, {1110.4140625, 817.0001220703125}, { 1110, 817}}}
550 </div>
551
552 <div id="cubicOp85d">
553 {{{1.0648664236068726, 2.9606373310089111}, {0.80208036362614099, 2.793648418027 2374}, {0.49170560730211144, 2.2292640182552783}, {0, 1}}}
554 {{{1.0648664236068726, 2.9606373310089111}, {0.6261905430171294, 3.2248910899179 175}, {0.38860045191888659, 2.9430022595944321}, {0, 1}}}
555 {{{1.0648664236068726, 2.9606373310089111}, {1.4282355765013004, 3.1915423487916 69}, {1.7006143409852195, 2.6626209548338378}, {2.2355968952178955, 2.0810616016 387939}}}
556 {{{1.0648664236068726, 2.9606373310089111}, {1.3437142856601656, 2.7926622975690 494}, {1.7038131304059798, 2.4040122748806132}, {2.2355968952178955, 2.081061601 6387939}}}
557 </div>
558
559 <div id="testQuads22">
560 {{{0, 0}, {1.20000004768371582, 0.8000000119209289551}}}
561 {{{0, 0}, {2, 0}}}
562 {{{0, 0}, {0, 1}, {3, 2}}}
563 {{{0, 0}, {1, 1}}}
564 </div>
565
566 <div id="cubicOp59d">
567 {{{4, 1}, {4, 0.37698365082686142}, {4.3881493046286568, 2.4710128800004547}, {3 .4716842174530029, 2.9292664527893066}}}
568 {{{4, 1}, {0, 1}}}
569 </div>
570
571 <div id="findFirst1">
572 {{{2.5767931938171387, 0.88524383306503296}, {2.4235948002142855, 0.886925014903 84834}, {2.2328897699358898, 0.92237007668803672}, {2, 1}}}
573 {{{2.5767931938171387, 0.88524383306503296}, {1.6008643534817426, 1.160901590746 3158}, {1.1200849961943122, 1.8138386966264941}, {0.75343161821365356, 2.7170474 529266357}}}
574 {{{2.5767931938171387, 0.88524383306503296}, {4.0492746201577932, 0.869084988486 19054}, {2.0567957107800288, 3.9721309710522448}, {0.75343161821365356, 2.717047 4529266357}}}
575 {{{2.5767931938171387, 0.88524383306503296}, {3.3470152174198557, 0.667689368878 79282}, {4.4256496583071421, 0.68512993166142844}, {6, 1}}}
576 {{{2.57679319, 0.885243833}, {5.15358639, 0.885243833}}}
577 </div>
578
579 <div id="testQuads54">
580 {{1.000,1.000}, {1.500,0.500}, {1.500,0.250}}
581 {{1.000,1.000}, {1.667,0.333}}
582 {{1.000,1.000}, {2.000,3.000}}
583 </div>
584
585 <div id="testQuads45">
586 {{{3, 3}, {3, 2.7999999523162842}, {2.880000114440918, 2.6400001049041748}}}
587 {{{3, 3}, {3, 2}, {2, 0}}}
588 {{{3, 3}, {2, 0}}}
589 {{{3, 3}, {2.880000114440918, 2.6400001049041748}}}
590 </div>
591
592 <div id="testQuads59">
593 {{{3, 1}, {3, 0}}}
594 {{{3, 1}, {2.6666667461395264, 0.66666668653488159}}}
595 {{{3, 1}, {2.8000003099441542, 1.1999996900558463}, {2.6800000667572021, 1.36000 00143051147}}}
596 {{{3, 1}, {2.6666667461395264, 1.3333333730697632}}}
597 </div>
598
599 <div id="skpcarrot_is24">
600 {{{1020.08099, 672.161987}, {1020.08051, 651.450988}, {1011.68576, 632.700988}, {998.113511, 619.128738}}}
601 {{{1020.08099, 672.161987}, {1019.27607, 640.291301}, {998.113511, 619.128738}}}
602 {{{1020, 672}, {1020, 651.289307}, {1012.67767, 633.611633}, {998.03302, 618.966 98}}}
603 {{{1020, 672}, {1020, 640.93396}, {998.03302, 618.96698}}}
604 </div>
605
606 <div id="skpcarrot_is24a">
607 {{{1020, 672}, {1020, 651.289307}, {1012.67767, 633.611633}, {998.03302, 618.966 98}}}
608 {{{1020, 672}, {1020, 640.93396}, {998.03302, 618.96698}}}
609 </div>
610
611 <div id="skpcarrot_is24b">
612 {{{1020.08099, 672.161987}, {1020.08051, 651.450988}, {1011.68576, 632.700988}, {998.113511, 619.128738}}}
613 {{{1020.08099, 672.161987}, {1019.27607, 640.291301}, {998.113511, 619.128738}}}
614 </div>
615
616 <div id="skpcarrot_is24c">
617 {{{{1020.08099,672.161987}, {1020.08002,630.73999}, {986.502014,597.161987}, {94 5.080994,597.161987}}},
618 {{{1020,672}, {1020,640.93396}, {998.03302,618.96698}}},
619 </div>
620
621 <div id="skpcarrot_is24d">
622 {{{1020.08099, 672.161987}, {1019.27607, 640.291301}, {998.113511, 619.128738}}}
623 {{{1020, 672}, {1020, 640.93396}, {998.03302, 618.96698}}}
624 </div>
625
626 <div id="skpcarrot_is24e">
627 {{{{1020.08099,672.161987}, {1020.08002,630.73999}, {986.502014,597.161987}, {94 5.080994,597.161987}}},
628 {{{1020.08099, 672.161987}, {1019.27607, 640.291301}, {998.113511, 619.128738}}}
629 {{{1020, 672}, {1020, 640.93396}, {998.03302, 618.96698}}}
630 </div>
631
632 <div id="slop1">
633 {{{-378.22698974609375, -987.8935546875}, {-47.53326416015625, 482.7139892578125 }, {-626.4708251953125, -338.62969970703125}, {-847.94854736328125, -861.4223022 4609375}}}
634 {{{-378.61790442466736, -987.49146723747253}, {-282.51787429804051, -556.3906528 6764685}, {-278.55106873374694, -364.17984985308294}}}
635 {{{-305.5273847156202, -615.99979442705023}, {-305.04071954345704, -612.87932617 187505}}}
636 </div>
637
638 qT=0.98917687 cT=0.788725084 dist=312.188493 cross=-40759.4852
639 <div id="slop2">
640 {{{79.5137939,-249.867188}, {260.778931,-561.349854}, {343.375977,-472.657898}, {610.251465,97.8208008}}}
641 {{{312.993284,-406.178762}, {418.053808,-326.9483}, {610.036929,97.2408578}}}
642 {{{463.107827,-200.015424}, {602.008878,79.5702581}}}
643 </div>
644
645 qT=0.0192863061 cT=0.241285225 dist=652.007881 cross=528435.665
646 <div id="slop3">
647 {{{-895.015015,-523.545288}, {223.166992,-999.644531}, {615.428711,-767.162109}, {605.479736,480.355713}}}
648 {{{-894.932414,-523.605499}, {-66.4040558,-889.938889}, {278.515212,-667.684158} }}
649 {{{-207.851881,-740.109296}, {-831.819002,-550.955104}}}
650 </div>
651
652 qT=0.0245724525 cT=0.231316637 dist=407.103004 cross=-46286.5686
653 <div id="slop4">
654 {{{876.492798,-849.716187}, {519.430908,-288.374207}, {187.2771,314.324341}, {33 5.363403,533.086548}}}
655 {{{876.323133,-849.535824}, {594.868958,-415.229224}, {416.667192,-30.0277669}}}
656 {{{638.343827,-458.798274}, {849.023879,-807.14691}}}
657 </div>
658
659 qT=0.000316393778 cT=0.248252634 dist=489.678412 cross=-57352.7653
660 <div id="slop5">
661 {{{876.492798,-849.716187}, {519.430908,-288.374207}, {187.2771,314.324341}, {33 5.363403,533.086548}}}
662 {{{876.147506,-849.184429}, {593.963775,-414.437342}, {416.842819,-30.3791618}}}
663 {{{622.139843,-430.512844}, {876.135915,-849.166571}}}
664 </div>
665
666 qT=0.989562776 cT=0.760518485 dist=211.50589 cross=134901.42
667 <div id="slop6">
668 {{{876.492798,-849.716187}, {519.430908,-288.374207}, {187.2771,314.324341}, {33 5.363403,533.086548}}}
669 {{{416.141554,-30.4534414}, {237.846068,356.664216}, {335.719378,533.692585}}}
670 {{{305.345404,315.701195}, {331.440368,525.591152}}}
671 </div>
672
673 qT=0.0978245708 cT=0.397465904 dist=959.737748 cross=158093.403
674 <div id="slop7">
675 {{{895.800171,-222.213013}, {-528.78833,526.47644}, {-967.299927,776.05603}, {-6 11.228027,319.934814}}}
676 {{{629.666617,-82.159942}, {-661.943328,620.81113}, {-723.44072,537.121833}}}
677 {{{-347.560585,421.003177}, {507.062151,-15.707855}}}
678 </div>
679
680 qT=0.169803964 cT=0.389326872 dist=658.039939 cross=107865.424
681 <div id="slop8">
682 {{{895.800171,-222.213013}, {-528.78833,526.47644}, {-967.299927,776.05603}, {-6 11.228027,319.934814}}}
683 {{{629.536617,-81.7990275}, {-662.457623,620.485316}, {-723.31072,536.760918}}}
684 {{{-330.996421,413.091598}, {257.080063,117.824582}}}
685 </div>
686
687 qT=0.0863836955 cT=0.387901231 dist=986.24777 cross=157348.113
688 <div id="slop9">
689 {{{895.800171,-222.213013}, {-528.78833,526.47644}, {-967.299927,776.05603}, {-6 11.228027,319.934814}}}
690 {{{629.248316,-81.8984216}, {-662.339696,620.351182}, {-723.022419,536.860313}}}
691 {{{-328.058099,411.68229}, {549.399512,-38.5985162}}}
692 </div>
693
694 qT=0.175359403 cT=0.390420692 dist=640.051938 cross=105488.084
695 <div id="slop10">
696 {{{895.800171,-222.213013}, {-528.78833,526.47644}, {-967.299927,776.05603}, {-6 11.228027,319.934814}}}
697 {{{629.760605,-81.9577046}, {-661.301606,620.029216}, {-723.534707,536.919596}}}
698 {{{-333.243516,414.168229}, {238.961251,127.37878}}}
699 </div>
700
701 qT=0.0986412358 cT=0.382365595 dist=921.951857 cross=145651.761
702 <div id="slop11">
703 {{{895.800171,-222.213013}, {-528.78833,526.47644}, {-967.299927,776.05603}, {-6 11.228027,319.934814}}}
704 {{{629.919588,-82.1841825}, {-662.488256,620.04494}, {-723.693691,537.146073}}}
705 {{{-316.541641,406.142013}, {504.067361,-14.0913644}}}
706 </div>
707
708 qT=0.146746849 cT=0.391456086 dist=750.006927 cross=123679.094
709 <div id="slop12">
710 {{{895.800171,-222.213013}, {-528.78833,526.47644}, {-967.299927,776.05603}, {-6 11.228027,319.934814}}}
711 {{{629.712675,-82.0366321}, {-661.487948,620.191832}, {-723.486777,536.998523}}}
712 {{{-335.364605,415.183549}, {334.079508,77.0194322}}}
713 </div>
714
715 qT=0.00196158131 cT=0.20357489 dist=466.080185 cross=241741.95
716 <div id="slop13">
717 {{{-627.671509,-359.277039}, {222.414551,-791.598328}, {390.603027,-581.903687}, {-21.7962036,560.33728}}}
718 {{{-627.675958,-359.282959}, {-52.012535,-659.029798}, {116.967835,-524.756101}} }
719 {{{-192.427848,-541.033993}, {-622.696937,-361.871356}}}
720 </div>
721
722 qT=0.948725598 cT=0.744200608 dist=699.694313 cross=179509.878
723 <div id="slop14">
724 {{{-362.331848,427.292603}, {634.418701,-661.946533}, {438.438599,-626.147278}, {-893.060425,214.243408}}}
725 {{{259.978301,-393.549091}, {181.692599,-474.452437}, {-892.389834,213.689096}}}
726 {{{-95.1310032,-267.365579}, {-696.89984,89.6307768}}}
727 </div>
728
729 qT=0.971677129 cT=0.755306143 dist=771.998962 cross=189468.817
730 <div id="slop15">
731 {{{-362.331848,427.292603}, {634.418701,-661.946533}, {438.438599,-626.147278}, {-893.060425,214.243408}}}
732 {{{259.662278,-393.355886}, {181.612843,-473.935297}, {-892.073812,213.495892}}}
733 {{{-120.438346,-253.451518}, {-782.461182,143.673352}}}
734 </div>
735
736 qT=0.571797795 cT=0.773951562 dist=495.560209 cross=221091.889
737 <div id="slop16">
738 {{{447.192383,-883.210205}, {359.794678,-987.765808}, {755.427612,-754.328735}, {963.672119,746.545776}}}
739 {{{635.795655,-580.726915}, {810.704547,-228.491534}, {963.345162,745.921688}}}
740 {{{801.470356,-87.7105789}, {646.551495,-558.433498}}}
741 </div>
742
743 qT=0.579236693 cT=0.782683167 dist=281.750564 cross=65125.1655
744 <div id="slop17">
745 {{{-931.259155,-883.589966}, {-485.682007,-615.793701}, {-68.5913696,-928.695923 }, {431.499268,-810.584778}}}
746 {{{-177.087049,-804.265618}, {110.452267,-866.525236}, {430.718323,-810.414444}} }
747 {{{116.080189,-836.904702}, {-164.080748,-807.017753}}}
748 </div>
749
750 qT=0.0102075348 cT=0.2448024 dist=855.408492 cross=463614.179
751 <div id="slop18">
752 {{{-867.011292,844.139282}, {-136.156799,-281.244263}, {583.27771,-926.761414}, {998.710205,6.19244385}}}
753 {{{-866.7221,843.65105}, {-308.756317,-34.8353977}, {183.843514,-346.222431}}}
754 {{{-336.612013,120.039627}, {-844.283739,808.5112}}}
755 </div>
756
757 qT=0.473968306 cT=0.266805943 dist=567.851844 cross=-461509.104
758 <div id="slop19">
759 {{{-867.011292,844.139282}, {-136.156799,-281.244263}, {583.27771,-926.761414}, {998.710205,6.19244385}}}
760 {{{-867.218781,844.133445}, {-310.496711,-35.0458119}, {184.340195,-346.704825}} }
761 {{{-290.018097,66.7065093}, {132.536746,-312.639141}}}
762 </div>
763
764 qT=0.0232589401 cT=0.241085469 dist=789.989464 cross=428119.544
765 <div id="slop20">
766 {{{-867.011292,844.139282}, {-136.156799,-281.244263}, {583.27771,-926.761414}, {998.710205,6.19244385}}}
767 {{{-866.942271,843.928587}, {-309.178151,-34.0018497}, {184.063685,-346.499968}} }
768 {{{-344.507162,129.265381}, {-815.30119,763.644082}}}
769 </div>
770
771 <div id="skpnamecheap_405">
772 {{{141.008835f, 837.9646f}, {141.235291f, 1109.05884f}}}
773 {{{141, 842}, {141.14502f, 1000}}}
774 {{{141.14502f, 1000}, {140, 1000}}}
775 </div>
776
777 <div id="skpwww_dealnews_com_315">
778 {{{969.87066650390625, 4279.810546875}, {967.7166748046875, 4260}}}
779 {{{969.87066650390625, 4279.810546875}, {969.866972698829386, 4279.8092338892847 69}, {969.88751220703125, 4279.81640625}}}
780 {{{969.87066650390625, 4279.810546875}, {970, 4281}}}
781 {{{969.87066650390625, 4279.810546875}, {968.9217161046863112, 4279.473236623693 992}, {968.17156982421875, 4278.53564453125}}}
782 {{{969.8706626470486754, 4279.810469740555163}, {969.8790796016525064, 4279.8134 61598796493}, {969.88751220703125, 4279.81640625}}}
783 </div>
784
785 <div id="skpwww_dealnews_com_315_a">
786 {{{969.8706626470486754, 4279.810469740555163}, {969.8790796016525064, 4279.8134 61598796493}, {969.88751220703125, 4279.81640625}}}
787 {{{969.87066650390625, 4279.810546875}, {969.8790834585100811, 4279.813538733241 33}}}
788 {{{969.88751220703125, 4279.81640625}, {969.8790796016525064, 4279.8134615987964 93}}}
789 </div>
790
791 <div id="testQuads60">
792 {{{2, 2}, {1.977731304590550021, 1.97773134708404541}, {1.95645439624786377, 1.9 5546269416809082}}}
793 {{{2, 2}, {2, 3}}}
794 {{{2, 2}, {2, 1.960000038146972656}}}
795 {{{2, 2}, {1.955341815948486328, 1.955341815948486328}}}
796 </div>
797
798 <div id="testQuads60_a">
799 {{{2, 0}, {1, 1}, {2, 2}}}
800 {{{2, 2}, {0, 0}}}
801 </div>
802
803 <div id="testQuads60_b">
804 {{2,1}, {0,2}, {3,2}},
805 {{3,2}, {2,3}},
806 {{2,3}, {2,1}},
807 {{0,0}, {2,0}},
808 {{2,0}, {1,1}, {2,2}},
809 {{2,2}, {0,0}},
810 </div>
811
812 <div id="skpelpais_com_18">
813 {{183,8507}, {552,8506.99023}},
814 {{552,8506.99023}, {552,8508}},
815 {{552,8508}, {183,8508}},
816 {{183,8508}, {183,8507}},
817 op intersect
818 {{183,8508}, {183,8506.99023}},
819 {{183,8506.99023}, {552,8507}},
820 {{552,8507}, {552,8508}},
821 </div>
822
823 <div id="skpwww_cityads_ru_249">
824 {{{1000, 10.4003992f}, {1000, 13.3527431f}}}
825 {{{1000, 13.3527431f}, {999.917603f, 13.2607508f}, {999.82843f, 13.1715727f}}}
826 {{{1000, 13}, {999.969971f, 37.0299988f}}}
827 </div>
828
829 </div>
830
831 <script type="text/javascript">
832
833 var testDivs = [
834 skpwww_cityads_ru_249,
835 skpelpais_com_18,
836 testQuads60_b,
837 testQuads60_a,
838 testQuads60,
839 skpwww_dealnews_com_315_a,
840 skpwww_dealnews_com_315,
841 skpnamecheap_405,
842 slop1,
843 slop2,
844 slop3,
845 slop4,
846 slop5,
847 slop6,
848 slop7,
849 slop8,
850 slop9,
851 slop10,
852 slop11,
853 slop12,
854 slop13,
855 slop14,
856 slop15,
857 slop16,
858 slop17,
859 slop18,
860 slop19,
861 slop20,
862 skpcarrot_is24e,
863 skpcarrot_is24d,
864 skpcarrot_is24c,
865 skpcarrot_is24b,
866 skpcarrot_is24a,
867 skpcarrot_is24,
868 testQuads59,
869 testQuads45,
870 testQuads54,
871 findFirst1,
872 cubicOp59d,
873 testQuads22,
874 cubicOp85d,
875 cubicOp104,
876 skpnational_com_au81,
877 cubicOp35d,
878 testQuad23,
879 testQuad22,
880 testQuad21,
881 testQuad15,
882 testQuadratic56,
883 xop1i,
884 xOp2i,
885 xop1u,
886 skpwww_joomla_org_23,
887 cubicOp109,
888 cubicOp106,
889 cubicOp105,
890 carpetplanet1,
891 eldorado1,
892 cubicOp25i,
893 cubicOp7d,
894 simplifyQuadratic27,
895 simplifyQuadratic56a,
896 simplifyQuadratic56,
897 quadratic58again,
898 simplifyQuadratic58a,
899 simplifyQuadratic58,
900 simplifyQuadratic36,
901 quad89987,
902 quad8741,
903 quad8b,
904 quad8a,
905 quad208,
906 quad67242,
907 quad37226,
908 quad35237,
909 quad108,
910 quad212,
911 quad3160,
912 quad640,
913 quad206,
914 quad136,
915 quad113,
916 quad999,
917 quad0,
918 quad179,
919 quad4a,
920 quad94,
921 quad77,
922 quad22a,
923 quad14a,
924 quad809,
925 quad653,
926 quad584,
927 quad413,
928 quad379,
929 quad159,
930 quad232,
931 quad40,
932 quad39,
933 quad38,
934 quad37,
935 quad36,
936 quad35,
937 quad34,
938 quad33,
939 quad32,
940 quad31,
941 quad30,
942 quad29,
943 quad28,
944 quad27,
945 quad26,
946 quad25,
947 quad24,
948 quad23,
949 quad22,
950 quad21,
951 quad20,
952 quad19,
953 quad18,
954 quad17,
955 quad16,
956 quad15,
957 quad14,
958 quad13,
959 quad12,
960 quad11,
961 cubic2,
962 cubic1,
963 quad1,
964 quad2,
965 quad3,
966 quad4,
967 quad5,
968 quad6,
969 quad7,
970 quad8,
971 quad9,
972 quad10,
973 ];
974
975 var tests = [];
976 var testTitles = [];
977 var testIndex = 0;
978 var ctx;
979 var subscale = 1;
980 var xmin, xmax, ymin, ymax;
981 var scale;
982 var initScale;
983 var mouseX, mouseY;
984 var mouseDown = false;
985 var srcLeft, srcTop;
986 var screenWidth, screenHeight;
987 var drawnPts;
988 var curveT = 0;
989
990 var lastX, lastY;
991 var activeCurve = [];
992 var activePt;
993
994 var decimal_places = 3;
995
996 var draw_t = false;
997 var draw_closest_t = false;
998 var draw_derivative = false;
999 var draw_endpoints = true;
1000 var draw_midpoint = 0;
1001 var draw_mouse_xy = false;
1002 var draw_order = false;
1003 var draw_point_xy = false;
1004 var draw_ray_intersect = false;
1005 var draw_quarterpoint = 0;
1006 var draw_tangents = 1;
1007 var draw_sortpoint = 0;
1008 var retina_scale = !!window.devicePixelRatio;
1009
1010 function parse(test, title) {
1011 var curveStrs = test.split("{{");
1012 var pattern = /-?\d+\.*\d*e?-?\d*/g;
1013 var curves = [];
1014 for (var c in curveStrs) {
1015 var curveStr = curveStrs[c];
1016 var points = curveStr.match(pattern);
1017 var pts = [];
1018 for (var wd in points) {
1019 var num = parseFloat(points[wd]);
1020 if (isNaN(num)) continue;
1021 pts.push(num);
1022 }
1023 if (pts.length > 2)
1024 curves.push(pts);
1025 }
1026 if (curves.length >= 1) {
1027 tests.push(curves);
1028 testTitles.push(title);
1029 }
1030 }
1031
1032 function init(test) {
1033 var canvas = document.getElementById('canvas');
1034 if (!canvas.getContext) return;
1035 ctx = canvas.getContext('2d');
1036 var resScale = retina_scale && window.devicePixelRatio ? window.devicePi xelRatio : 1;
1037 var unscaledWidth = window.innerWidth - 20;
1038 var unscaledHeight = window.innerHeight - 20;
1039 screenWidth = unscaledWidth;
1040 screenHeight = unscaledHeight;
1041 canvas.width = unscaledWidth * resScale;
1042 canvas.height = unscaledHeight * resScale;
1043 canvas.style.width = unscaledWidth + 'px';
1044 canvas.style.height = unscaledHeight + 'px';
1045 if (resScale != 1) {
1046 ctx.scale(resScale, resScale);
1047 }
1048 xmin = Infinity;
1049 xmax = -Infinity;
1050 ymin = Infinity;
1051 ymax = -Infinity;
1052 for (var curves in test) {
1053 var curve = test[curves];
1054 var last = curve.length;
1055 for (var idx = 0; idx < last; idx += 2) {
1056 xmin = Math.min(xmin, curve[idx]);
1057 xmax = Math.max(xmax, curve[idx]);
1058 ymin = Math.min(ymin, curve[idx + 1]);
1059 ymax = Math.max(ymax, curve[idx + 1]);
1060 }
1061 }
1062 xmin -= 1;
1063 var testW = xmax - xmin;
1064 var testH = ymax - ymin;
1065 subscale = 1;
1066 while (testW * subscale < 0.1 && testH * subscale < 0.1) {
1067 subscale *= 10;
1068 }
1069 while (testW * subscale > 10 && testH * subscale > 10) {
1070 subscale /= 10;
1071 }
1072 setScale(xmin, xmax, ymin, ymax);
1073 mouseX = (screenWidth / 2) / scale + srcLeft;
1074 mouseY = (screenHeight / 2) / scale + srcTop;
1075 initScale = scale;
1076 }
1077
1078 function setScale(x0, x1, y0, y1) {
1079 var srcWidth = x1 - x0;
1080 var srcHeight = y1 - y0;
1081 var usableWidth = screenWidth;
1082 var xDigits = Math.ceil(Math.log(Math.abs(xmax)) / Math.log(10));
1083 var yDigits = Math.ceil(Math.log(Math.abs(ymax)) / Math.log(10));
1084 usableWidth -= (xDigits + yDigits) * 10;
1085 usableWidth -= decimal_places * 10;
1086 var hscale = usableWidth / srcWidth;
1087 var vscale = screenHeight / srcHeight;
1088 scale = Math.min(hscale, vscale);
1089 var invScale = 1 / scale;
1090 var sxmin = x0 - invScale * 5;
1091 var symin = y0 - invScale * 10;
1092 var sxmax = x1 + invScale * (6 * decimal_places + 10);
1093 var symax = y1 + invScale * 10;
1094 srcWidth = sxmax - sxmin;
1095 srcHeight = symax - symin;
1096 hscale = usableWidth / srcWidth;
1097 vscale = screenHeight / srcHeight;
1098 scale = Math.min(hscale, vscale);
1099 srcLeft = sxmin;
1100 srcTop = symin;
1101 }
1102
1103 function dxy_at_t(curve, t) {
1104 var dxy = {};
1105 if (curve.length == 6) {
1106 var a = t - 1;
1107 var b = 1 - 2 * t;
1108 var c = t;
1109 dxy.x = a * curve[0] + b * curve[2] + c * curve[4];
1110 dxy.y = a * curve[1] + b * curve[3] + c * curve[5];
1111 } else if (curve.length == 8) {
1112 var one_t = 1 - t;
1113 var a = curve[0];
1114 var b = curve[2];
1115 var c = curve[4];
1116 var d = curve[6];
1117 dxy.x = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t);
1118 a = curve[1];
1119 b = curve[3];
1120 c = curve[5];
1121 d = curve[7];
1122 dxy.y = 3 * ((b - a) * one_t * one_t + 2 * (c - b) * t * one_t + (d - c) * t * t);
1123 }
1124 return dxy;
1125 }
1126
1127 var flt_epsilon = 1.19209290E-07;
1128
1129 function approximately_zero(A) {
1130 return Math.abs(A) < flt_epsilon;
1131 }
1132
1133 function approximately_zero_inverse(A) {
1134 return Math.abs(A) > (1 / flt_epsilon);
1135 }
1136
1137 function quad_real_roots(A, B, C) {
1138 var s = [];
1139 var p = B / (2 * A);
1140 var q = C / A;
1141 if (approximately_zero(A) && (approximately_zero_inverse(p)
1142 || approximately_zero_inverse(q))) {
1143 if (approximately_zero(B)) {
1144 if (C == 0) {
1145 s[0] = 0;
1146 }
1147 return s;
1148 }
1149 s[0] = -C / B;
1150 return s;
1151 }
1152 /* normal form: x^2 + px + q = 0 */
1153 var p2 = p * p;
1154 if (!approximately_zero(p2 - q) && p2 < q) {
1155 return s;
1156 }
1157 var sqrt_D = 0;
1158 if (p2 > q) {
1159 sqrt_D = Math.sqrt(p2 - q);
1160 }
1161 s[0] = sqrt_D - p;
1162 var flip = -sqrt_D - p;
1163 if (!approximately_zero(s[0] - flip)) {
1164 s[1] = flip;
1165 }
1166 return s;
1167 }
1168
1169 function cubic_real_roots(A, B, C, D) {
1170 if (approximately_zero(A)) { // we're just a quadratic
1171 return quad_real_roots(B, C, D);
1172 }
1173 if (approximately_zero(D)) { // 0 is one root
1174 var s = quad_real_roots(A, B, C);
1175 for (var i = 0; i < s.length; ++i) {
1176 if (approximately_zero(s[i])) {
1177 return s;
1178 }
1179 }
1180 s.push(0);
1181 return s;
1182 }
1183 if (approximately_zero(A + B + C + D)) { // 1 is one root
1184 var s = quad_real_roots(A, A + B, -D);
1185 for (var i = 0; i < s.length; ++i) {
1186 if (approximately_zero(s[i] - 1)) {
1187 return s;
1188 }
1189 }
1190 s.push(1);
1191 return s;
1192 }
1193 var a, b, c;
1194 var invA = 1 / A;
1195 a = B * invA;
1196 b = C * invA;
1197 c = D * invA;
1198 var a2 = a * a;
1199 var Q = (a2 - b * 3) / 9;
1200 var R = (2 * a2 * a - 9 * a * b + 27 * c) / 54;
1201 var R2 = R * R;
1202 var Q3 = Q * Q * Q;
1203 var R2MinusQ3 = R2 - Q3;
1204 var adiv3 = a / 3;
1205 var r;
1206 var roots = [];
1207 if (R2MinusQ3 < 0) { // we have 3 real roots
1208 var theta = Math.acos(R / Math.sqrt(Q3));
1209 var neg2RootQ = -2 * Math.sqrt(Q);
1210 r = neg2RootQ * Math.cos(theta / 3) - adiv3;
1211 roots.push(r);
1212 r = neg2RootQ * Math.cos((theta + 2 * Math.PI) / 3) - adiv3;
1213 if (!approximately_zero(roots[0] - r)) {
1214 roots.push(r);
1215 }
1216 r = neg2RootQ * Math.cos((theta - 2 * Math.PI) / 3) - adiv3;
1217 if (!approximately_zero(roots[0] - r) && (roots.length == 1
1218 || !approximately_zero(roots[1] - r))) {
1219 roots.push(r);
1220 }
1221 } else { // we have 1 real root
1222 var sqrtR2MinusQ3 = Math.sqrt(R2MinusQ3);
1223 var A = Math.abs(R) + sqrtR2MinusQ3;
1224 A = Math.pow(A, 1/3);
1225 if (R > 0) {
1226 A = -A;
1227 }
1228 if (A != 0) {
1229 A += Q / A;
1230 }
1231 r = A - adiv3;
1232 roots.push(r);
1233 if (approximately_zero(R2 - Q3)) {
1234 r = -A / 2 - adiv3;
1235 if (!approximately_zero(s[0] - r)) {
1236 roots.push(r);
1237 }
1238 }
1239 }
1240 return roots;
1241 }
1242
1243 function approximately_zero_or_more(tValue) {
1244 return tValue >= -flt_epsilon;
1245 }
1246
1247 function approximately_one_or_less(tValue) {
1248 return tValue <= 1 + flt_epsilon;
1249 }
1250
1251 function approximately_less_than_zero(tValue) {
1252 return tValue < flt_epsilon;
1253 }
1254
1255 function approximately_greater_than_one(tValue) {
1256 return tValue > 1 - flt_epsilon;
1257 }
1258
1259 function add_valid_ts(s) {
1260 var t = [];
1261 nextRoot:
1262 for (var index = 0; index < s.length; ++index) {
1263 var tValue = s[index];
1264 if (approximately_zero_or_more(tValue) && approximately_one_or_less( tValue)) {
1265 if (approximately_less_than_zero(tValue)) {
1266 tValue = 0;
1267 } else if (approximately_greater_than_one(tValue)) {
1268 tValue = 1;
1269 }
1270 for (var idx2 = 0; idx2 < t.length; ++idx2) {
1271 if (approximately_zero(t[idx2] - tValue)) {
1272 continue nextRoot;
1273 }
1274 }
1275 t.push(tValue);
1276 }
1277 }
1278 return t;
1279 }
1280
1281 function quad_roots(A, B, C) {
1282 var s = quad_real_roots(A, B, C);
1283 var foundRoots = add_valid_ts(s);
1284 return foundRoots;
1285 }
1286
1287 function cubic_roots(A, B, C, D) {
1288 var s = cubic_real_roots(A, B, C, D);
1289 var foundRoots = add_valid_ts(s);
1290 return foundRoots;
1291 }
1292
1293 function ray_curve_intersect(startPt, endPt, curve) {
1294 var adj = endPt[0] - startPt[0];
1295 var opp = endPt[1] - startPt[1];
1296 var r = [];
1297 for (var n = 0; n < curve.length / 2; ++n) {
1298 r[n] = (curve[n * 2 + 1] - startPt[1]) * adj - (curve[n * 2] - start Pt[0]) * opp;
1299 }
1300 if (curve.length == 6) {
1301 var A = r[2];
1302 var B = r[1];
1303 var C = r[0];
1304 A += C - 2 * B; // A = a - 2*b + c
1305 B -= C; // B = -(b - c)
1306 return quad_roots(A, 2 * B, C);
1307 }
1308 var A = r[3]; // d
1309 var B = r[2] * 3; // 3*c
1310 var C = r[1] * 3; // 3*b
1311 var D = r[0]; // a
1312 A -= D - C + B; // A = -a + 3*b - 3*c + d
1313 B += 3 * D - 2 * C; // B = 3*a - 6*b + 3*c
1314 C -= 3 * D; // C = -3*a + 3*b
1315 return cubic_roots(A, B, C, D);
1316 }
1317
1318 function x_at_t(curve, t) {
1319 var one_t = 1 - t;
1320 if (curve.length == 4) {
1321 return one_t * curve[0] + t * curve[2];
1322 }
1323 var one_t2 = one_t * one_t;
1324 var t2 = t * t;
1325 if (curve.length == 6) {
1326 return one_t2 * curve[0] + 2 * one_t * t * curve[2] + t2 * curve[4];
1327 }
1328 var a = one_t2 * one_t;
1329 var b = 3 * one_t2 * t;
1330 var c = 3 * one_t * t2;
1331 var d = t2 * t;
1332 return a * curve[0] + b * curve[2] + c * curve[4] + d * curve[6];
1333 }
1334
1335 function y_at_t(curve, t) {
1336 var one_t = 1 - t;
1337 if (curve.length == 4) {
1338 return one_t * curve[1] + t * curve[3];
1339 }
1340 var one_t2 = one_t * one_t;
1341 var t2 = t * t;
1342 if (curve.length == 6) {
1343 return one_t2 * curve[1] + 2 * one_t * t * curve[3] + t2 * curve[5];
1344 }
1345 var a = one_t2 * one_t;
1346 var b = 3 * one_t2 * t;
1347 var c = 3 * one_t * t2;
1348 var d = t2 * t;
1349 return a * curve[1] + b * curve[3] + c * curve[5] + d * curve[7];
1350 }
1351
1352 function drawPointAtT(curve) {
1353 var x = x_at_t(curve, curveT);
1354 var y = y_at_t(curve, curveT);
1355 drawPoint(x, y);
1356 }
1357
1358 function drawLine(x1, y1, x2, y2) {
1359 ctx.beginPath();
1360 ctx.moveTo((x1 - srcLeft) * scale,
1361 (y1 - srcTop) * scale);
1362 ctx.lineTo((x2 - srcLeft) * scale,
1363 (y2 - srcTop) * scale);
1364 ctx.stroke();
1365 }
1366
1367 function drawPoint(px, py) {
1368 for (var pts = 0; pts < drawnPts.length; pts += 2) {
1369 var x = drawnPts[pts];
1370 var y = drawnPts[pts + 1];
1371 if (px == x && py == y) {
1372 return;
1373 }
1374 }
1375 drawnPts.push(px);
1376 drawnPts.push(py);
1377 var _px = (px - srcLeft) * scale;
1378 var _py = (py - srcTop) * scale;
1379 ctx.beginPath();
1380 ctx.arc(_px, _py, 3, 0, Math.PI * 2, true);
1381 ctx.closePath();
1382 ctx.stroke();
1383 if (draw_point_xy) {
1384 var label = px.toFixed(decimal_places) + ", " + py.toFixed(decimal_p laces);
1385 ctx.font = "normal 10px Arial";
1386 ctx.textAlign = "left";
1387 ctx.fillStyle = "black";
1388 ctx.fillText(label, _px + 5, _py);
1389 }
1390 }
1391
1392 function drawPointSolid(px, py) {
1393 drawPoint(px, py);
1394 ctx.fillStyle = "rgba(0,0,0, 0.4)";
1395 ctx.fill();
1396 }
1397
1398 function crossPt(origin, pt1, pt2) {
1399 return ((pt1[0] - origin[0]) * (pt2[1] - origin[1])
1400 - (pt1[1] - origin[1]) * (pt2[0] - origin[0])) > 0 ? 0 : 1;
1401 }
1402
1403 // may not work well for cubics
1404 function curveClosestT(curve, x, y) {
1405 var closest = -1;
1406 var closestDist = Infinity;
1407 var l = Infinity, t = Infinity, r = -Infinity, b = -Infinity;
1408 for (var i = 0; i < 16; ++i) {
1409 var testX = x_at_t(curve, i / 16);
1410 l = Math.min(testX, l);
1411 r = Math.max(testX, r);
1412 var testY = y_at_t(curve, i / 16);
1413 t = Math.min(testY, t);
1414 b = Math.max(testY, b);
1415 var dx = testX - x;
1416 var dy = testY - y;
1417 var dist = dx * dx + dy * dy;
1418 if (closestDist > dist) {
1419 closestDist = dist;
1420 closest = i;
1421 }
1422 }
1423 var boundsX = r - l;
1424 var boundsY = b - t;
1425 var boundsDist = boundsX * boundsX + boundsY * boundsY;
1426 if (closestDist > boundsDist) {
1427 return -1;
1428 }
1429 console.log("closestDist = " + closestDist + " boundsDist = " + boundsDi st
1430 + " t = " + closest / 16);
1431 return closest / 16;
1432 }
1433
1434 function draw(test, title) {
1435 ctx.font = "normal 50px Arial";
1436 ctx.textAlign = "left";
1437 ctx.fillStyle = "rgba(0,0,0, 0.1)";
1438 ctx.fillText(title, 50, 50);
1439 ctx.font = "normal 10px Arial";
1440 // ctx.lineWidth = "1.001"; "0.999";
1441 var hullStarts = [];
1442 var hullEnds = [];
1443 var midSpokes = [];
1444 var midDist = [];
1445 var origin = [];
1446 var shortSpokes = [];
1447 var shortDist = [];
1448 var sweeps = [];
1449 drawnPts = [];
1450 for (var curves in test) {
1451 var curve = test[curves];
1452 origin.push(curve[0]);
1453 origin.push(curve[1]);
1454 var startPt = [];
1455 startPt.push(curve[2]);
1456 startPt.push(curve[3]);
1457 hullStarts.push(startPt);
1458 var endPt = [];
1459 if (curve.length == 4) {
1460 endPt.push(curve[2]);
1461 endPt.push(curve[3]);
1462 } else if (curve.length == 6) {
1463 endPt.push(curve[4]);
1464 endPt.push(curve[5]);
1465 } else if (curve.length == 8) {
1466 endPt.push(curve[6]);
1467 endPt.push(curve[7]);
1468 }
1469 hullEnds.push(endPt);
1470 var sweep = crossPt(origin, startPt, endPt);
1471 sweeps.push(sweep);
1472 var midPt = [];
1473 midPt.push(x_at_t(curve, 0.5));
1474 midPt.push(y_at_t(curve, 0.5));
1475 midSpokes.push(midPt);
1476 var shortPt = [];
1477 shortPt.push(x_at_t(curve, 0.25));
1478 shortPt.push(y_at_t(curve, 0.25));
1479 shortSpokes.push(shortPt);
1480 var dx = midPt[0] - origin[0];
1481 var dy = midPt[1] - origin[1];
1482 var dist = Math.sqrt(dx * dx + dy * dy);
1483 midDist.push(dist);
1484 dx = shortPt[0] - origin[0];
1485 dy = shortPt[1] - origin[1];
1486 dist = Math.sqrt(dx * dx + dy * dy);
1487 shortDist.push(dist);
1488 }
1489 var intersect = [];
1490 var useIntersect = false;
1491 var maxWidth = Math.max(xmax - xmin, ymax - ymin);
1492 for (var curves in test) {
1493 var curve = test[curves];
1494 if (curve.length == 6 || curve.length == 8) {
1495 var opp = curves == 1 ? 0 : 1;
1496 var sects = ray_curve_intersect(origin, hullEnds[opp], curve);
1497 intersect.push(sects);
1498 if (sects.length > 1) {
1499 var intersection = sects[0];
1500 if (intersection == 0) {
1501 intersection = sects[1];
1502 }
1503 var ix = x_at_t(curve, intersection) - origin[0];
1504 var iy = y_at_t(curve, intersection) - origin[1];
1505 var ex = hullEnds[opp][0] - origin[0];
1506 var ey = hullEnds[opp][1] - origin[1];
1507 if (ix * ex >= 0 && iy * ey >= 0) {
1508 var iDist = Math.sqrt(ix * ix + iy * iy);
1509 var eDist = Math.sqrt(ex * ex + ey * ey);
1510 var delta = Math.abs(iDist - eDist) / maxWidth;
1511 if (delta > (curve.length == 6 ? 1e-5 : 1e-4)) {
1512 useIntersect ^= true;
1513 }
1514 }
1515 }
1516 }
1517 }
1518 var midLeft = crossPt(origin, midSpokes[0], midSpokes[1]);
1519 var firstInside;
1520 if (useIntersect) {
1521 var sect1 = intersect[0].length > 1;
1522 var sIndex = sect1 ? 0 : 1;
1523 var sects = intersect[sIndex];
1524 var intersection = sects[0];
1525 if (intersection == 0) {
1526 intersection = sects[1];
1527 }
1528 var curve = test[sIndex];
1529 var ix = x_at_t(curve, intersection) - origin[0];
1530 var iy = y_at_t(curve, intersection) - origin[1];
1531 var opp = sect1 ? 1 : 0;
1532 var ex = hullEnds[opp][0] - origin[0];
1533 var ey = hullEnds[opp][1] - origin[1];
1534 var iDist = ix * ix + iy * iy;
1535 var eDist = ex * ex + ey * ey;
1536 firstInside = (iDist > eDist) ^ (sIndex == 0) ^ sweeps[0];
1537 // console.log("iDist=" + iDist + " eDist=" + eDist + " sIndex=" + sI ndex
1538 // + " sweeps[0]=" + sweeps[0]);
1539 } else {
1540 // console.log("midLeft=" + midLeft);
1541 firstInside = midLeft != 0;
1542 }
1543 var shorter = midDist[1] < midDist[0];
1544 var shortLeft = shorter ? crossPt(origin, shortSpokes[0], midSpokes[1])
1545 : crossPt(origin, midSpokes[0], shortSpokes[1]);
1546 var startCross = crossPt(origin, hullStarts[0], hullStarts[1]);
1547 var disallowShort = midLeft == startCross && midLeft == sweeps[0]
1548 && midLeft == sweeps[1];
1549
1550 // console.log("midLeft=" + midLeft + " startCross=" + startCross);
1551 var intersectIndex = 0;
1552 for (var curves in test) {
1553 var curve = test[curves];
1554 if (curve.length != 4 && curve.length != 6 && curve.length != 8) {
1555 continue;
1556 }
1557 ctx.lineWidth = 1;
1558 if (draw_tangents != 0) {
1559 if (firstInside == curves) {
1560 ctx.strokeStyle = "rgba(255,0,0, 0.3)";
1561 } else {
1562 ctx.strokeStyle = "rgba(0,0,255, 0.3)";
1563 }
1564 drawLine(curve[0], curve[1], curve[2], curve[3]);
1565 if (draw_tangents != 2) {
1566 if (curve.length > 4) drawLine(curve[2], curve[3], curve[4], curve[5]);
1567 if (curve.length > 6) drawLine(curve[4], curve[5], curve[6], curve[7]);
1568 }
1569 if (draw_tangents != 1) {
1570 if (curve.length == 6) drawLine(curve[0], curve[1], curve[4] , curve[5]);
1571 if (curve.length == 8) drawLine(curve[0], curve[1], curve[6] , curve[7]);
1572 }
1573 }
1574 ctx.beginPath();
1575 ctx.moveTo((curve[0] - srcLeft) * scale, (curve[1] - srcTop) * scale );
1576 if (curve.length == 4) {
1577 ctx.lineTo((curve[2] - srcLeft) * scale, (curve[3] - srcTop) * s cale);
1578 } else if (curve.length == 6) {
1579 ctx.quadraticCurveTo(
1580 (curve[2] - srcLeft) * scale, (curve[3] - srcTop) * scale,
1581 (curve[4] - srcLeft) * scale, (curve[5] - srcTop) * scale);
1582 } else {
1583 ctx.bezierCurveTo(
1584 (curve[2] - srcLeft) * scale, (curve[3] - srcTop) * scale,
1585 (curve[4] - srcLeft) * scale, (curve[5] - srcTop) * scale,
1586 (curve[6] - srcLeft) * scale, (curve[7] - srcTop) * scale);
1587 }
1588 if (firstInside == curves) {
1589 ctx.strokeStyle = "rgba(255,0,0, 1)";
1590 } else {
1591 ctx.strokeStyle = "rgba(0,0,255, 1)";
1592 }
1593 ctx.stroke();
1594 if (draw_endpoints) {
1595 drawPoint(curve[0], curve[1]);
1596 drawPoint(curve[2], curve[3]);
1597 if (curve.length > 4) drawPoint(curve[4], curve[5]);
1598 if (curve.length > 6) drawPoint(curve[6], curve[7]);
1599 }
1600 if (draw_midpoint != 0) {
1601 if ((curves == 0) == (midLeft == 0)) {
1602 ctx.strokeStyle = "rgba(0,180,127, 0.6)";
1603 } else {
1604 ctx.strokeStyle = "rgba(127,0,127, 0.6)";
1605 }
1606 var midX = x_at_t(curve, 0.5);
1607 var midY = y_at_t(curve, 0.5);
1608 drawPointSolid(midX, midY);
1609 if (draw_midpoint > 1) {
1610 drawLine(curve[0], curve[1], midX, midY);
1611 }
1612 }
1613 if (draw_quarterpoint != 0) {
1614 if ((curves == 0) == (shortLeft == 0)) {
1615 ctx.strokeStyle = "rgba(0,191,63, 0.6)";
1616 } else {
1617 ctx.strokeStyle = "rgba(63,0,191, 0.6)";
1618 }
1619 var midT = (curves == 0) == shorter ? 0.25 : 0.5;
1620 var midX = x_at_t(curve, midT);
1621 var midY = y_at_t(curve, midT);
1622 drawPointSolid(midX, midY);
1623 if (draw_quarterpoint > 1) {
1624 drawLine(curve[0], curve[1], midX, midY);
1625 }
1626 }
1627 if (draw_sortpoint != 0) {
1628 if ((curves == 0) == ((disallowShort == -1 ? midLeft : shortLeft ) == 0)) {
1629 ctx.strokeStyle = "rgba(0,155,37, 0.6)";
1630 } else {
1631 ctx.strokeStyle = "rgba(37,0,155, 0.6)";
1632 }
1633 var midT = (curves == 0) == shorter && disallowShort != curves ? 0.25 : 0.5;
1634 console.log("curves=" + curves + " disallowShort=" + disallowSho rt
1635 + " midLeft=" + midLeft + " shortLeft=" + shortLeft
1636 + " shorter=" + shorter + " midT=" + midT);
1637 var midX = x_at_t(curve, midT);
1638 var midY = y_at_t(curve, midT);
1639 drawPointSolid(midX, midY);
1640 if (draw_sortpoint > 1) {
1641 drawLine(curve[0], curve[1], midX, midY);
1642 }
1643 }
1644 if (draw_ray_intersect != 0) {
1645 ctx.strokeStyle = "rgba(75,45,199, 0.6)";
1646 if (curve.length == 6 || curve.length == 8) {
1647 var intersections = intersect[intersectIndex];
1648 for (var i in intersections) {
1649 var intersection = intersections[i];
1650 var x = x_at_t(curve, intersection);
1651 var y = y_at_t(curve, intersection);
1652 drawPointSolid(x, y);
1653 if (draw_ray_intersect > 1) {
1654 drawLine(curve[0], curve[1], x, y);
1655 }
1656 }
1657 }
1658 ++intersectIndex;
1659 }
1660 if (draw_order) {
1661 var px = x_at_t(curve, 0.75);
1662 var py = y_at_t(curve, 0.75);
1663 var _px = (px - srcLeft) * scale;
1664 var _py = (py - srcTop) * scale;
1665 ctx.beginPath();
1666 ctx.arc(_px, _py, 15, 0, Math.PI * 2, true);
1667 ctx.closePath();
1668 ctx.fillStyle = "white";
1669 ctx.fill();
1670 if (firstInside == curves) {
1671 ctx.strokeStyle = "rgba(255,0,0, 1)";
1672 ctx.fillStyle = "rgba(255,0,0, 1)";
1673 } else {
1674 ctx.strokeStyle = "rgba(0,0,255, 1)";
1675 ctx.fillStyle = "rgba(0,0,255, 1)";
1676 }
1677 ctx.stroke();
1678 ctx.font = "normal 16px Arial";
1679 ctx.textAlign = "center";
1680 ctx.fillText(parseInt(curves) + 1, _px, _py + 5);
1681 }
1682 if (draw_closest_t) {
1683 var t = curveClosestT(curve, mouseX, mouseY);
1684 if (t >= 0) {
1685 var x = x_at_t(curve, t);
1686 var y = y_at_t(curve, t);
1687 drawPointSolid(x, y);
1688 }
1689 }
1690 if (!approximately_zero(scale - initScale)) {
1691 ctx.font = "normal 20px Arial";
1692 ctx.fillStyle = "rgba(0,0,0, 0.3)";
1693 ctx.textAlign = "right";
1694 ctx.fillText(scale.toFixed(decimal_places) + 'x',
1695 screenWidth - 10, screenHeight - 5);
1696 }
1697 if (draw_t) {
1698 drawPointAtT(curve);
1699 }
1700 }
1701 if (draw_t) {
1702 drawCurveTControl();
1703 }
1704 }
1705
1706 function drawCurveTControl() {
1707 ctx.lineWidth = 2;
1708 ctx.strokeStyle = "rgba(0,0,0, 0.3)";
1709 ctx.beginPath();
1710 ctx.rect(screenWidth - 80, 40, 28, screenHeight - 80);
1711 ctx.stroke();
1712 var ty = 40 + curveT * (screenHeight - 80);
1713 ctx.beginPath();
1714 ctx.moveTo(screenWidth - 80, ty);
1715 ctx.lineTo(screenWidth - 85, ty - 5);
1716 ctx.lineTo(screenWidth - 85, ty + 5);
1717 ctx.lineTo(screenWidth - 80, ty);
1718 ctx.fillStyle = "rgba(0,0,0, 0.6)";
1719 ctx.fill();
1720 var num = curveT.toFixed(decimal_places);
1721 ctx.font = "normal 10px Arial";
1722 ctx.textAlign = "left";
1723 ctx.fillText(num, screenWidth - 78, ty);
1724 }
1725
1726 function ptInTControl() {
1727 var e = window.event;
1728 var tgt = e.target || e.srcElement;
1729 var left = tgt.offsetLeft;
1730 var top = tgt.offsetTop;
1731 var x = (e.clientX - left);
1732 var y = (e.clientY - top);
1733 if (x < screenWidth - 80 || x > screenWidth - 50) {
1734 return false;
1735 }
1736 if (y < 40 || y > screenHeight - 80) {
1737 return false;
1738 }
1739 curveT = (y - 40) / (screenHeight - 120);
1740 if (curveT < 0 || curveT > 1) {
1741 throw "stop execution";
1742 }
1743 return true;
1744 }
1745
1746 function drawTop() {
1747 init(tests[testIndex]);
1748 redraw();
1749 }
1750
1751 function redraw() {
1752 ctx.beginPath();
1753 ctx.rect(0, 0, ctx.canvas.width, ctx.canvas.height);
1754 ctx.fillStyle = "white";
1755 ctx.fill();
1756 draw(tests[testIndex], testTitles[testIndex]);
1757 }
1758
1759 function doKeyPress(evt) {
1760 var char = String.fromCharCode(evt.charCode);
1761 switch (char) {
1762 case '0':
1763 case '1':
1764 case '2':
1765 case '3':
1766 case '4':
1767 case '5':
1768 case '6':
1769 case '7':
1770 case '8':
1771 case '9':
1772 decimal_places = char - '0';
1773 redraw();
1774 break;
1775 case '-':
1776 scale /= 2;
1777 calcLeftTop();
1778 redraw();
1779 break;
1780 case '=':
1781 case '+':
1782 scale *= 2;
1783 calcLeftTop();
1784 redraw();
1785 break;
1786 case 'c':
1787 drawTop();
1788 break;
1789 case 'd':
1790 var test = tests[testIndex];
1791 var testClone = [];
1792 for (var curves in test) {
1793 var c = test[curves];
1794 var cClone = [];
1795 for (var index = 0; index < c.length; ++index) {
1796 cClone.push(c[index]);
1797 }
1798 testClone.push(cClone);
1799 }
1800 tests.push(testClone);
1801 testTitles.push(testTitles[testIndex] + " copy");
1802 testIndex = tests.length - 1;
1803 redraw();
1804 break;
1805 case 'e':
1806 draw_endpoints ^= true;
1807 redraw();
1808 break;
1809 case 'f':
1810 draw_derivative ^= true;
1811 redraw();
1812 break;
1813 case 'i':
1814 draw_ray_intersect = (draw_ray_intersect + 1) % 3;
1815 redraw();
1816 break;
1817 case 'l':
1818 var test = tests[testIndex];
1819 console.log("<div id=\"" + testTitles[testIndex] + "\" >");
1820 for (var curves in test) {
1821 var c = test[curves];
1822 var s = "{{";
1823 for (var i = 0; i < c.length; i += 2) {
1824 s += "{";
1825 s += c[i] + "," + c[i + 1];
1826 s += "}";
1827 if (i + 2 < c.length) {
1828 s += ", ";
1829 }
1830 }
1831 console.log(s + "}},");
1832 }
1833 console.log("</div>");
1834 break;
1835 case 'm':
1836 draw_midpoint = (draw_midpoint + 1) % 3;
1837 redraw();
1838 break;
1839 case 'N':
1840 testIndex += 9;
1841 case 'n':
1842 testIndex = (testIndex + 1) % tests.length;
1843 drawTop();
1844 break;
1845 case 'o':
1846 draw_order ^= true;
1847 redraw();
1848 break;
1849 case 'P':
1850 testIndex -= 9;
1851 case 'p':
1852 if (--testIndex < 0)
1853 testIndex = tests.length - 1;
1854 drawTop();
1855 break;
1856 case 'q':
1857 draw_quarterpoint = (draw_quarterpoint + 1) % 3;
1858 redraw();
1859 break;
1860 case 'r':
1861 for (var i = 0; i < testDivs.length; ++i) {
1862 var title = testDivs[i].id.toString();
1863 if (title == testTitles[testIndex]) {
1864 var str = testDivs[i].firstChild.data;
1865 parse(str, title);
1866 var original = tests.pop();
1867 testTitles.pop();
1868 tests[testIndex] = original;
1869 break;
1870 }
1871 }
1872 redraw();
1873 break;
1874 case 's':
1875 draw_sortpoint = (draw_sortpoint + 1) % 3;
1876 redraw();
1877 break;
1878 case 't':
1879 draw_t ^= true;
1880 redraw();
1881 break;
1882 case 'u':
1883 draw_closest_t ^= true;
1884 redraw();
1885 break;
1886 case 'v':
1887 draw_tangents = (draw_tangents + 1) % 4;
1888 redraw();
1889 break;
1890 case 'x':
1891 draw_point_xy ^= true;
1892 redraw();
1893 break;
1894 case 'y':
1895 draw_mouse_xy ^= true;
1896 redraw();
1897 break;
1898 case '\\':
1899 retina_scale ^= true;
1900 drawTop();
1901 break;
1902 }
1903 }
1904
1905 function doKeyDown(evt) {
1906 var char = evt.keyCode;
1907 var preventDefault = false;
1908 switch (char) {
1909 case 37: // left arrow
1910 if (evt.shiftKey) {
1911 testIndex -= 9;
1912 }
1913 if (--testIndex < 0)
1914 testIndex = tests.length - 1;
1915 drawTop();
1916 preventDefault = true;
1917 break;
1918 case 39: // right arrow
1919 if (evt.shiftKey) {
1920 testIndex += 9;
1921 }
1922 if (++testIndex >= tests.length)
1923 testIndex = 0;
1924 drawTop();
1925 preventDefault = true;
1926 break;
1927 }
1928 if (preventDefault) {
1929 evt.preventDefault();
1930 return false;
1931 }
1932 return true;
1933 }
1934
1935 function calcXY() {
1936 var e = window.event;
1937 var tgt = e.target || e.srcElement;
1938 var left = tgt.offsetLeft;
1939 var top = tgt.offsetTop;
1940 mouseX = (e.clientX - left) / scale + srcLeft;
1941 mouseY = (e.clientY - top) / scale + srcTop;
1942 }
1943
1944 function calcLeftTop() {
1945 srcLeft = mouseX - screenWidth / 2 / scale;
1946 srcTop = mouseY - screenHeight / 2 / scale;
1947 }
1948
1949 function handleMouseClick() {
1950 if (!draw_t || !ptInTControl()) {
1951 calcXY();
1952 } else {
1953 redraw();
1954 }
1955 }
1956
1957 function initDown() {
1958 var test = tests[testIndex];
1959 var bestDistance = 1000000;
1960 activePt = -1;
1961 for (var curves in test) {
1962 var testCurve = test[curves];
1963 if (testCurve.length != 4 && testCurve.length != 6 && testCurve.leng th != 8) {
1964 continue;
1965 }
1966 for (var i = 0; i < testCurve.length; i += 2) {
1967 var testX = testCurve[i];
1968 var testY = testCurve[i + 1];
1969 var dx = testX - mouseX;
1970 var dy = testY - mouseY;
1971 var dist = dx * dx + dy * dy;
1972 if (dist > bestDistance) {
1973 continue;
1974 }
1975 activeCurve = testCurve;
1976 activePt = i;
1977 bestDistance = dist;
1978 }
1979 }
1980 if (activePt >= 0) {
1981 lastX = mouseX;
1982 lastY = mouseY;
1983 }
1984 }
1985
1986 function handleMouseOver() {
1987 calcXY();
1988 if (draw_mouse_xy) {
1989 var num = mouseX.toFixed(decimal_places) + ", " + mouseY.toFixed(dec imal_places);
1990 ctx.beginPath();
1991 ctx.rect(300, 100, num.length * 6, 10);
1992 ctx.fillStyle = "white";
1993 ctx.fill();
1994 ctx.font = "normal 10px Arial";
1995 ctx.fillStyle = "black";
1996 ctx.textAlign = "left";
1997 ctx.fillText(num, 300, 108);
1998 }
1999 if (!mouseDown) {
2000 activePt = -1;
2001 return;
2002 }
2003 if (activePt < 0) {
2004 initDown();
2005 return;
2006 }
2007 var deltaX = mouseX - lastX;
2008 var deltaY = mouseY - lastY;
2009 lastX = mouseX;
2010 lastY = mouseY;
2011 if (activePt == 0) {
2012 var test = tests[testIndex];
2013 for (var curves in test) {
2014 var testCurve = test[curves];
2015 testCurve[0] += deltaX;
2016 testCurve[1] += deltaY;
2017 }
2018 } else {
2019 activeCurve[activePt] += deltaX;
2020 activeCurve[activePt + 1] += deltaY;
2021 }
2022 redraw();
2023 }
2024
2025 function start() {
2026 for (var i = 0; i < testDivs.length; ++i) {
2027 var title = testDivs[i].id.toString();
2028 var str = testDivs[i].firstChild.data;
2029 parse(str, title);
2030 }
2031 drawTop();
2032 window.addEventListener('keypress', doKeyPress, true);
2033 window.addEventListener('keydown', doKeyDown, true);
2034 window.onresize = function () {
2035 drawTop();
2036 }
2037 }
2038
2039 </script>
2040 </head>
2041
2042 <body onLoad="start();">
2043
2044 <canvas id="canvas" width="750" height="500"
2045 onmousedown="mouseDown = true"
2046 onmouseup="mouseDown = false"
2047 onmousemove="handleMouseOver()"
2048 onclick="handleMouseClick()"
2049 ></canvas >
2050 </body>
2051 </html>
OLDNEW
« no previous file with comments | « tests/skia_test.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698