Skip to content

Add triangles intersect usage example - #802

Open
ekam313 wants to merge 1 commit into
thoth-tech:mainfrom
ekam313:doc/usage-example-triangles-intersect
Open

Add triangles intersect usage example#802
ekam313 wants to merge 1 commit into
thoth-tech:mainfrom
ekam313:doc/usage-example-triangles-intersect

Conversation

@ekam313

@ekam313 ekam313 commented Aug 2, 2026

Copy link
Copy Markdown

Description

This pull request adds a new SplashKit usage example for the
triangles_intersect function in the Geometry category.

The example displays one fixed triangle and one triangle that follows the
mouse. The program continuously checks whether the two triangles intersect.
The moving triangle and the displayed message change depending on the boolean
result returned by triangles_intersect.

The example is implemented consistently in C++, C# top-level statements,
C# object-oriented format, and Python. A descriptive title and GIF are also
included.

No additional dependencies are required.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation (update or new)

How Has This Been Tested?

All four code versions were run locally. The following behaviour was verified:

  • The fixed triangle displays correctly.
  • The moving triangle follows the mouse.
  • The program correctly detects intersecting triangles.
  • The program correctly detects non-intersecting triangles.
  • The displayed colour and text update correctly.
  • The program closes without errors.

The website was also built and previewed locally to confirm that the example
appears under the correct function and that the GIF and code files display
correctly.

Testing Checklist

  • Tested in latest Chrome
  • Tested in latest Firefox
  • npm run build
  • npm run preview

Checklist

If involving code

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Folders and Files Added/Modified

  • Added:
    • public/usage-examples/geometry/triangles_intersect-1-example.cpp
    • public/usage-examples/geometry/triangles_intersect-1-example-top-level.cs
    • public/usage-examples/geometry/triangles_intersect-1-example-oop.cs
    • public/usage-examples/geometry/triangles_intersect-1-example.py
    • public/usage-examples/geometry/triangles_intersect-1-example.txt
    • public/usage-examples/geometry/triangles_intersect-1-example.gif

Additional Notes

The GIF demonstrates both the intersecting and non-intersecting states by moving
the second triangle with the mouse.

@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for splashkit ready!

Name Link
🔨 Latest commit b228e74
🔍 Latest deploy log https://app.netlify.com/projects/splashkit/deploys/6a6edf03e49b8e0008547841
😎 Deploy Preview https://deploy-preview-802--splashkit.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Osaid2993 Osaid2993 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekam313, Please remove the comments that only repeat the code, such as:

  • Define a fixed triangle
  • Create a triangle that follows the mouse
  • Check whether the triangles intersect

Comments should explain why, not restate the code. Please update this consistently across all four versions.

@AAMIRAU AAMIRAU left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example itself looks good and the intersection behaviour is clearly demonstrated. I noticed the previously requested cleanup of comments that only restate the code is still pending across the language versions. Once those comments are removed or updated, this should be good to go.

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.

3 participants