Skip to content

Add distant_point_on_circle usage example#701

Open
ekam313 wants to merge 2 commits intothoth-tech:mainfrom
ekam313:add-distant-point-on-circle-example
Open

Add distant_point_on_circle usage example#701
ekam313 wants to merge 2 commits intothoth-tech:mainfrom
ekam313:add-distant-point-on-circle-example

Conversation

@ekam313
Copy link

@ekam313 ekam313 commented Mar 21, 2026

Description

Added a new usage example for the distant_point_on_circle function in the Geometry category.

This example demonstrates how to calculate and visually display the point on a circle that is furthest from a given reference point. The mouse position is used as the reference point, and the distant point updates dynamically in real time.

The example is designed to be beginner-friendly and clearly illustrates the geometric relationship between the circle center, reference point, and distant point using visual elements.

No additional dependencies were required.

Type of change

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

How Has This Been Tested?

The implementation was tested across multiple language versions to ensure correctness, consistency, and adherence to SplashKit usage example guidelines.

Python version was executed using:

skm python3 program.py

Verified that:

  • the window opens successfully
  • the circle is rendered at the center
  • the mouse position updates dynamically
  • the distant point is correctly calculated and remains on the circle
  • visual elements (points, lines, labels) render correctly in real time

C# versions (top-level and OOP) were tested using:

dotnet run

Verified that the application runs correctly and produces consistent behaviour with the Python version.

C++ version was compiled and executed using:

g++ program.cpp -l SplashKit -o test_program
./test_program

Verified that the program compiles successfully and renders the expected graphical output.

The example was also validated within the local website environment using:

npm run dev

Confirmed that:

  • files are correctly detected
  • example appears under the Geometry category
  • title and associated files render correctly
  • All files were checked to ensure:
  • correct naming conventions
  • correct folder placement
  • consistency across all language implementations
  • compliance with usage example and style guidelines
  • No runtime errors were encountered after final fixes, and behaviour is consistent across all tested versions.

Testing Checklist

  • Tested in latest Chrome
  • Tested in latest Firefox
  • 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

Please list the folders and files added/modified with this pull request and delete options that are not relevant.

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

Additional Notes

This example follows the usage example guidelines:

minimal and focused implementation
clear visual demonstration
consistent comments across languages
beginner-friendly structure

This is an initial usage example for the function and can be extended in future with additional variations if needed.

@netlify
Copy link

netlify bot commented Mar 21, 2026

Deploy Preview for splashkit failed.

Name Link
🔨 Latest commit dd52387
🔍 Latest deploy log https://app.netlify.com/projects/splashkit/deploys/69c549bcd53d480008875dce

Copy link

@Osaid2993 Osaid2993 left a comment

Choose a reason for hiding this comment

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

Approved. This is a clear and beginner-friendly usage example, and the visual output makes the function easy to understand.

I only had two small suggestions. The window variables in the C# and C++ versions seem unused, so removing them could keep the code cleaner. I also noticed the instruction text is slightly different across languages, so making it consistent may help beginners compare the example more easily.

keep up the good work!

@ekam313
Copy link
Author

ekam313 commented Mar 26, 2026

Thanks for the feedback! I’ve removed the unused window variables to improve code clarity and made the instruction text consistent across all language versions for better readability.

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.

2 participants