HTML Dairenin Çapı İle Çevresini Hesaplama
Aşağıda verdiğim sayfa ile çemberin çapını mm olarak girerek çevresini cm cinsinden alabiliyorsunuz. Örnek sayfayı EK'ten indirebilirsiniz.
<!DOCTYPE html > <html lang ="en" > <head > <meta charset ="UTF-8" > <meta name ="viewport" content ="width=device-width, initial-scale=1.0" > <title > Çember Çevresi Hesaplama</title > <style > body { font-family : Arial, sans-serif; text-align : center; margin : 20px ; } label { display : block; margin-bottom : 5px ; } input { padding : 5px ; margin-bottom : 10px ; } button { padding : 8px ; background-color : #4caf50 ; color : white; border : none; cursor : pointer; } button :hover { background-color : #45a049 ; } </style > </head > <body > <h2 > Çember Çevresi Hesaplama</h2 > <label for ="diameter" > Çap (mm):</label > <input type ="number" id ="diameter" placeholder ="Çapı girin" required > <br > <button onclick ="calculateCircumference()" > Dönüştür</button > <p id ="result" > </p > <script > function calculateCircumference ( ) { var diameter = document .getElementById("diameter" ).value; var radius = diameter / 2 ; var circumference = 2 * Math .PI * radius; </script > </body > </html >
(1.47 KB - Yükleme: %1$d 0 .)
(57.01 KB , 1080x579 - Gösterim: %1$d 41 .)