Selasa, 11 Juni 2013
Kamis, 23 Mei 2013
Membuat Kabel Melengkung
Mau bikin garis melengkung di html, akhirnya mencari dulu ke mbah google.
Akhirnya ketemu deh 1. Coba dulu ah...
// Create the triangular path (with rounded corners)
context.beginPath();
// Top Corner
context.moveTo(canvasWidth/2 - x, this.padding);
context.quadraticCurveTo(canvasWidth/2, this.padding - y, canvasWidth/2 + x, this.padding);
// Right Corner
context.lineTo((canvasWidth + this.width)/2 + gamma, this.padding + this.height - gamma);
context.quadraticCurveTo((canvasWidth + this.width)/2 + y, this.padding + this.height + this.innerBorder, (canvasWidth + this.width)/2, this.padding + this.height + this.innerBorder);
// Left Corner
context.lineTo((canvasWidth - this.width)/2, this.padding + this.height + this.innerBorder);
context.quadraticCurveTo((canvasWidth - this.width)/2 - y, this.padding + this.height + this.innerBorder, (canvasWidth - this.width)/2 - gamma, this.padding + this.height - gamma);
// Close Path
context.lineTo(canvasWidth/2 - x, this.padding);
context.closePath();
http://www.williammalone.com/articles/flash-vs-html5-canvas-drawing/
Akhirnya ketemu deh 1. Coba dulu ah...
// Create the triangular path (with rounded corners)
context.beginPath();
// Top Corner
context.moveTo(canvasWidth/2 - x, this.padding);
context.quadraticCurveTo(canvasWidth/2, this.padding - y, canvasWidth/2 + x, this.padding);
// Right Corner
context.lineTo((canvasWidth + this.width)/2 + gamma, this.padding + this.height - gamma);
context.quadraticCurveTo((canvasWidth + this.width)/2 + y, this.padding + this.height + this.innerBorder, (canvasWidth + this.width)/2, this.padding + this.height + this.innerBorder);
// Left Corner
context.lineTo((canvasWidth - this.width)/2, this.padding + this.height + this.innerBorder);
context.quadraticCurveTo((canvasWidth - this.width)/2 - y, this.padding + this.height + this.innerBorder, (canvasWidth - this.width)/2 - gamma, this.padding + this.height - gamma);
// Close Path
context.lineTo(canvasWidth/2 - x, this.padding);
context.closePath();
http://www.williammalone.com/articles/flash-vs-html5-canvas-drawing/
Minggu, 05 Mei 2013
Senin, 01 April 2013
Rumus Luas Segi-n Sembarang
Ini dia rumus Luas segi-n sembarang
Kebetulan saya mau buat program yang mencari titik pusat segi 4.
Googling, akhirnya ketemu juga.
Alhamdulillah :)
sumber: http://maruzar.blogspot.com/2011/12/luas-polygon-tak-beraturan-dan.html
Senin, 25 Maret 2013
Langganan:
Komentar (Atom)


