Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
se2aa4_cs2me3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
W. Spencer Smith
se2aa4_cs2me3
Commits
93411736
Commit
93411736
authored
7 years ago
by
Sepehr Bayat
Browse files
Options
Downloads
Patches
Plain Diff
Delete PointMassADT.py
parent
6d1e82ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tutorials/T04-A2Example/src/PointMassADT.py
+0
-48
0 additions, 48 deletions
Tutorials/T04-A2Example/src/PointMassADT.py
with
0 additions
and
48 deletions
Tutorials/T04-A2Example/src/PointMassADT.py
deleted
100644 → 0
+
0
−
48
View file @
6d1e82ef
## @file pointADT.py
# @author Gurankash Singh
# @brief Provides the PointMass ADT class for representing point masses
# @date 30 Jan 2017
from
PointADT
import
*
##@brief An ADT that respresents a 2D point
class
pointMassT
:
UNIVERSAL_G
=
6.672e-11
## @brief PointMassT constructor
# @details Initializes a PointMassT object with a point and corresponding mass value
# @param p The coordinates of the point type pointT
# @param m The mass value
def
__init__
(
self
,
p
,
m
):
self
.
__pt
=
p
self
.
__ms
=
m
## @brief Gets the coordinates of the point
# @return The point of type pointT
def
point
(
self
):
return
self
.
__pt
## @brief Gets the mass the point
# @return The the mass value
def
mval
(
self
):
return
self
.
__ms
## @brief Determines the force between 2 point masses
# @details Uses the force formula with UniversalG constant
# @param p Another point mass
# @return The force between the given point masses
def
force
(
self
,
p
):
m
=
self
.
__ms
*
p
.
mval
()
r
=
dist
(
self
.
__pt
,
point
(
p
))
return
UNIVERSAL_G
*
m
/
(
r
**
2
)
## @brief Determines the force vector between the 2 point masses
# @details Uses the force vector formula
# @param p Another point mass
# @return The force vector
def
Fx
(
self
,
p
):
xDist
=
point
(
p
).
xcoord
()
-
self
.
__pt
.
xcoord
()
r
=
dist
(
self
.
__pt
,
point
(
p
))
return
self
.
__force
(
p
)
*
(
xDist
/
r
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment