mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Settle on Position/Direction, declared in position.h
This commit is contained in:
parent
f7649a61dc
commit
0fba0e287c
11 changed files with 275 additions and 257 deletions
63
src/position.cpp
Normal file
63
src/position.cpp
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
#include "position.h"
|
||||
|
||||
namespace openmc {
|
||||
|
||||
//==============================================================================
|
||||
// Position implementation
|
||||
//==============================================================================
|
||||
|
||||
Position&
|
||||
Position::operator+=(Position other)
|
||||
{
|
||||
x += other.x;
|
||||
y += other.y;
|
||||
z += other.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Position&
|
||||
Position::operator+=(double v)
|
||||
{
|
||||
x += v;
|
||||
y += v;
|
||||
z += v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Position&
|
||||
Position::operator-=(Position other)
|
||||
{
|
||||
x -= other.x;
|
||||
y -= other.y;
|
||||
z -= other.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Position&
|
||||
Position::operator-=(double v)
|
||||
{
|
||||
x -= v;
|
||||
y -= v;
|
||||
z -= v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Position&
|
||||
Position::operator*=(Position other)
|
||||
{
|
||||
x *= other.x;
|
||||
y *= other.y;
|
||||
z *= other.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Position&
|
||||
Position::operator*=(double v)
|
||||
{
|
||||
x *= v;
|
||||
y *= v;
|
||||
z *= v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
} // namespace openmc
|
||||
Loading…
Add table
Add a link
Reference in a new issue