Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by monq ( 14 years ago )
#include "Segment.h"
Segment::Segment(void)
{
Sx=0;Sy=0;area=0;Cx=0;Cy=0;Ixx=0;Iyy=0;Ixy=0;
angle=0.0;
}
Segment::~Segment(void)
{
}
//-------------------------------------------
void Segment::translate(mmInt tx, mmInt ty)
{
for (mmInt i=0;i<pixels.size();i++)
{
pixels[i].first += tx;
pixels[i].second += ty;
}
}
//-----------------------------------------------
void Segment::rotate(mmReal theta)
{
for (mmInt i=0;i<pixels.size();i++)
{
pixels[i].first = pixels[i].first*cos(angle) - pixels[i].second*sin(angle);
pixels[i].second = pixels[i].first*sin(angle) + pixels[i].second*cos(angle);
}
}
//---------------------------
Revise this Paste