Basic Angle Relationship Prover (Parallel Lines)

Basic Angle Relationship Prover (Parallel Lines)

This tool helps determine angle values and their relationships when two parallel lines are intersected by a transversal.

Step 1: Define Known Angle

L1 L2 T L1 || L2 1 2 4 3 5 6 8 7

Step 2: Select Angle to Prove

Step 3: Proof and Result

Please complete the previous steps to see the proof.

Could not determine Angle ${targetAngleNum} based on the information provided.

`; } // Switch to the result tab if (barp_resultTabButtonEl) barp_resultTabButtonEl.click(); } function barp_downloadPdf() { const { jsPDF } = window.jspdf; if (typeof jsPDF === 'undefined') { alert('Error: jsPDF library is not loaded. Cannot generate PDF.'); return; } if (typeof html2canvas === 'undefined') { alert('Error: html2canvas library is not loaded. Cannot generate PDF.'); return; } const resultsContent = document.getElementById('barp-resultsOutput'); if (!resultsContent || resultsContent.textContent.trim() === "Please complete the previous steps to see the proof.") { alert("Please generate the proof first before downloading the PDF."); return; } const toolContainer = document.getElementById('barp-tool-container'); const originalStyles = { border: toolContainer.style.border, boxShadow: toolContainer.style.boxShadow, padding: toolContainer.style.padding, margin: toolContainer.style.margin, }; // Temporarily modify styles for PDF generation to isolate content toolContainer.style.border = 'none'; toolContainer.style.boxShadow = 'none'; //toolContainer.style.padding = '0'; // Keep some padding for aesthetics in PDF //toolContainer.style.margin = '0'; const pdfHeader = `Basic Angle Relationship Prover (Parallel Lines) - Results`; html2canvas(resultsContent, { scale: 2, backgroundColor: null, useCORS: true }).then(canvas => { const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = pdf.internal.pageSize.getHeight(); const margin = 40; // points const contentWidth = pdfWidth - 2 * margin; // Add title pdf.setFontSize(16); pdf.setTextColor(parseInt(getComputedStyle(document.documentElement).getPropertyValue('--primary-color').substring(1,3),16), parseInt(getComputedStyle(document.documentElement).getPropertyValue('--primary-color').substring(3,5),16), parseInt(getComputedStyle(document.documentElement).getPropertyValue('--primary-color').substring(5,7),16)); pdf.text(pdfHeader, margin, margin); const imgProps = pdf.getImageProperties(imgData); const imgHeight = (imgProps.height * contentWidth) / imgProps.width; let currentHeight = margin + 30; if (currentHeight + imgHeight > pdfHeight - margin) { pdf.addPage(); currentHeight = margin; } pdf.addImage(imgData, 'PNG', margin, currentHeight, contentWidth, imgHeight); // Restore original styles toolContainer.style.border = originalStyles.border; toolContainer.style.boxShadow = originalStyles.boxShadow; toolContainer.style.padding = originalStyles.padding; toolContainer.style.margin = originalStyles.margin; pdf.save('Angle-Proof-Results.pdf'); }).catch(err => { console.error("Error generating PDF: ", err); alert("An error occurred while generating the PDF. Please check the console."); // Restore original styles even on error toolContainer.style.border = originalStyles.border; toolContainer.style.boxShadow = originalStyles.boxShadow; toolContainer.style.padding = originalStyles.padding; toolContainer.style.margin = originalStyles.margin; }); }
Scroll to Top