03/12/22 20:26 87OLcIqY
>>356
インデントくずれてたらごめん
#define PI3.1415926
void hexagon::draw( HDC hdc )
{
int x,y,first_x,first_y;
vector2 v( this->x , this->y ) ,v2( 50 , 0 ),v3( 0 , 0 );
float theta = 0;
int i;
v3 = v+v2;
first_x = x = (int)v3.x;
first_y = y = (int)v3.y;
MoveToEx( hdc , x , y , NULL );
for( i = 0 ; i < 6 ; i++ ) {
theta += (1.0/3.0)*PI;
v3 = v2.rotate( theta );
v3 = v3+v;
x = (int)v3.x;
y = (int)v3.y;
LineTo( hdc , x , y );
}
LineTo( hdc , first_x , first_y );
}