Skip to content

Conversation

Copy link

Copilot AI commented Nov 7, 2025

Adds display of minimum vertical and horizontal angles based on anchor spacing and work area dimensions.

Changes

Calculations

  • Horizontal Gap = (Width - Work Area Width) / 2
  • Vertical Gap = (Height - Work Area Height) / 2
  • Vertical Minimum Angle = arctan(Vertical Gap / (Horizontal Gap + Work Area Width))
  • Horizontal Minimum Angle = arctan(Horizontal Gap / (Vertical Gap + Work Area Height))

UI

  • New "Minimum Angles" section in controls panel
  • Displays angles in degrees (2 decimals) and sine values (4 decimals)
  • Updates dynamically when dimensions change

Implementation

Added updateMinimumAngles() function that computes angles from current dimensions:

function updateMinimumAngles() {
    const width = trX;
    const height = tlY;
    const horizontalGap = (width - woodWidth) / 2;
    const verticalGap = (height - woodHeight) / 2;
    
    const verticalMinAngleRad = Math.atan(verticalGap / (horizontalGap + woodWidth));
    const horizontalMinAngleRad = Math.atan(horizontalGap / (verticalGap + woodHeight));
    // ... convert to degrees and update display
}

Screenshots

Minimum angles display

Dynamic updates

Original prompt

This section details on the original issue you should resolve

<issue_title>Display minimum Vertical and Horizontal angles</issue_title>
<issue_description>The Layout-Simulator should display two new text outputs, the Vertical Minimum Angle and Horizontal Minimum Angle.

Two intermediate values are needed:
Horizontal Gap = (Width - Work Area Width) / 2
Vertical Gap = (Height - Work Area Height) / 2

From those, the Vertical Minimum Angle and Horizontal Minimum Angle can be calculated using the right angled triangle formula.

The Vertical Minimum Angle should be calculated with the Adjacent side = Horizontal Gap + Work Area Width, and the Opposite side = Vertical Gap.

The Horizontal Minimum Angle should be calculated with the Adjacent side = Vertical Gap + Work Area Height, and the Opposite side = Horizontal Gap.

An additional feature could also be to add the sin of each of Vertical Minimum Angle and Horizontal Minimum Angle as additional outputs.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: BarbourSmith <9359447+BarbourSmith@users.noreply.github.com>
Copilot AI changed the title [WIP] Display minimum vertical and horizontal angles in simulator Add minimum vertical and horizontal angle calculations Nov 7, 2025
Copilot AI requested a review from BarbourSmith November 7, 2025 21:30
@BarbourSmith
Copy link
Member

@DaveCoulthurst here is what the AI came up with:

index.html

You should be able to just double click it and it will open in a browser tab. If you have any feedback feel free to comment it here and I'll relay it to the AI

@DaveCoulthurst
Copy link

Maths checked, LGTM.

Do you want me to try and write an explanation of what / why it is, or not clutter things up?

@BarbourSmith
Copy link
Member

I saw some discussion in the forums that maybe this isn't the right approach? Does this still seem right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display minimum Vertical and Horizontal angles

3 participants