ScratchData LogoScratchData
Back to Flash_Programmer's profile

Surprising Mathematics

FLFlash_Programmer•Created April 3, 2023
Surprising Mathematics
7
3
73 views
View on Scratch

Instructions

Click to place a point Press x over a point to delete it Press 1 to toggle type 1 grid snapping Press 2 to toggle type 2 grid snapping (my algorithm) Press 3 to toggle type 3 grid snap (brute force optimal) Press 4 to toggle type 4 grid snapping (custom offsets) Press 5 to put points back in their original positions Press q to toggle average distance display New: Press 6 for median grid snap (very decent approach) Hold space and move the mouse to customise offset Press a to generate graphs (red is x axis, blue is y axis, the sharper colours are the raw data with the generated sine curve laying over top) The graph also shows the two median points for each curve (an experiment)

Description

This is a demonstration of a problem I've been working on for a few days. It basically has to do with snapping points to a grid and the goal is to move the grid x and y offsets around such that the average distance that the points must travel to conform to the grid is minimised. There is a detailed description of the problem if you hit "See inside"

Project Details

Project ID830078994
CreatedApril 3, 2023
Last ModifiedApril 18, 2023
SharedApril 10, 2023
Visibilityvisible
CommentsAllowed