-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforce.h
More file actions
39 lines (32 loc) · 977 Bytes
/
force.h
File metadata and controls
39 lines (32 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Author: Nolan Schirripa, Christine Seng, Erick Martinez, Georgia Rushing, Graham Balas
* Assignment Title: Group Project (force.h)
* Assignment Description: declares force class that adds and sets forces to ball
* Due Date: 12/09/2024
* Date Created: 10/25/2024
* Date Last Modified: 12/07/2024
*/
#ifndef FORCE_H
#define FORCE_H
#include <cmath>
#include <ostream>
class force{
private:
double magnitude;
double direction; // radian
public:
force();
force(double m, double d);
void setMagnitude(double m);
void setDirection(double d);
double getMagnitude()const;
double getDirection()const;
force operator+(const force& other) const;
force operator=(const force& other);
force add(const force& other) const;
void apply(const force& other);
void display(std::ostream& os)const{
os << getMagnitude() << " " << getDirection() << std::endl;
}
};
#endif //FORCE_H