Angle Analyzer
Calculate and visualize angles with ease. Enter the values below to get started.
Please enter valid angles.
"; return; } const sum = angle1 + angle2; const difference = Math.abs(angle1 - angle2); resultsDiv.innerHTML = `Sum of Angles: ${sum}°
Difference Between Angles: ${difference}°
`; // Draw angles on canvas const canvas = document.getElementById('angleCanvas'); const ctx = canvas.getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height); // Draw angle 1 ctx.beginPath(); ctx.moveTo(150, 150); ctx.lineTo(300, 150); ctx.lineTo(150 + 150 * Math.cos((angle1 * Math.PI) / 180), 150 - 150 * Math.sin((angle1 * Math.PI) / 180)); ctx.strokeStyle = '#ff6f61'; ctx.lineWidth = 3; ctx.stroke(); // Draw angle 2 ctx.beginPath(); ctx.moveTo(150, 150); ctx.lineTo(300, 150); ctx.lineTo(150 + 150 * Math.cos((angle2 * Math.PI) / 180), 150 - 150 * Math.sin((angle2 * Math.PI) / 180)); ctx.strokeStyle = '#4CAF50'; ctx.lineWidth = 3; ctx.stroke(); // Show PDF button pdfButton.style.display = 'inline-block'; } // Function to reset the tool function resetTool() { document.getElementById('angle1').value = ''; document.getElementById('angle2').value = ''; document.getElementById('results').innerHTML = ''; document.getElementById('pdfButton').style.display = 'none'; const canvas = document.getElementById('angleCanvas'); const ctx = canvas.getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height); } // Function to download PDF function downloadPDF() { const { jsPDF } = window.jspdf; const doc = new jsPDF(); const results = document.getElementById('results').innerText; doc.setFontSize(16); doc.text('Angle Analyzer Results', 10, 10); doc.setFontSize(12); doc.text(results, 10, 20); doc.save('Angle_Analyzer_Results.pdf'); }The Angle Analyzer is a powerful tool designed to help users calculate and visualize angles. Whether you’re working on geometry problems, engineering designs, or simply exploring angles, this tool provides an intuitive interface to input two angles, calculate their sum and difference, and visualize them on a canvas. The results can also be downloaded as a PDF for easy sharing and documentation.
User Guide
Input Angles: Enter two angles (in degrees) into the input fields labeled “Enter Angle 1” and “Enter Angle 2.”
Calculate: Click the “Calculate” button to compute the sum and difference of the angles. The results will be displayed below the input fields.
Visualize: The angles will be visualized on a canvas, with each angle represented by a colored line.
Reset: Click the “Reset” button to clear all inputs, results, and the canvas.
Download PDF: After calculating, click the “Download PDF” button to save the results as a PDF file.
