{"id":15746281,"url":"https://github.com/hanse00/classes-in-python---testing","last_synced_at":"2025-03-31T06:23:21.043Z","repository":{"id":15261655,"uuid":"17990778","full_name":"Hanse00/Classes-in-Python---testing","owner":"Hanse00","description":"How to create a class to store 2D world data for modelling and animation with Visual Python","archived":false,"fork":false,"pushed_at":"2014-03-21T19:19:41.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T10:52:55.432Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"MatejKustec/SpinThatShit","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hanse00.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-21T18:57:31.000Z","updated_at":"2016-04-18T23:19:24.000Z","dependencies_parsed_at":"2022-09-05T03:00:34.704Z","dependency_job_id":null,"html_url":"https://github.com/Hanse00/Classes-in-Python---testing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanse00%2FClasses-in-Python---testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanse00%2FClasses-in-Python---testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanse00%2FClasses-in-Python---testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hanse00%2FClasses-in-Python---testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hanse00","download_url":"https://codeload.github.com/Hanse00/Classes-in-Python---testing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246424889,"owners_count":20775036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T05:00:19.099Z","updated_at":"2025-03-31T06:23:21.018Z","avatar_url":"https://github.com/Hanse00.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Classes-in-Python---testing\n\nIn this project I explore how to create a class to store 2D world data for modelling and animation with Visual Python.\n\nI am also testing GitHub as a way to store my code, and I am curious about the collaborative aspects of using GitHub.\n\nMy idea is to define a very simple 2D world of say 10 x 10 elements, arranged in a vertical matrix. Then I would \nlike to explore what happens when an object x is released at top row and allowed to fall and collide with say \nwater-like objects, 8, that are in the bottom rows. Except for the x and 8 objects there are no other physical \nobjects in the world. The 0 objects are just empty space.\n\n```\n00123456789\n100000x0000  \n20000000000  \n30000000000  \n40000000000  \n50000000000  \n60000000000  \n78888888888  \n88888888888  \n98888888888\n```\n\nSome data for the world could be:\n* gravity: g\n* size: x, y\n\nFor each element I plan to store information about the initial condition, like:\n* position: x0, y0\n* velocity: vx0, vy0\n* acceleration: ax0, ay0\n* mass: m0\n* color: c0 (In r, g, b values)\n\nSome information about boundary conditions should be stored for each element. In my simple world I will start with the \nfollowing assumptions:\n* the world is vertical. That is, one row of elements is on the ground, then the next row is placed right on top of it and so on.\n* the elements on the edge can not move. (Or should I allow them to move away and leave the world?)\n* the bottom row of elements sits firmly on \"the ground\".\n* the mass of the elements\n\nI think I will include member variables in the element class to store the dynamical values that vil be created and \nused during the animation. These will in the general case include many of the same physical parameters that are stored for definition of the initial conditions:\n* x,y\n* vx, vy\n* ax, ay\n* m\n* c\n\nThen I think I will need some rules to calculate the new velocity after collision of two elements. I will start with:\n* movement can only be in the x or y directions (this is very limiting, will produce uninteresting animations, I think)\n* when an element falls on and collides with another element, then 80% of the impuls energy is transfered to the element\nbelow the element and 10% to the elements that are on each side of it. If there are no elements adjacent then the \nenergy disappears.\n\nOk, these are my first thoughts on the problem.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanse00%2Fclasses-in-python---testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanse00%2Fclasses-in-python---testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanse00%2Fclasses-in-python---testing/lists"}