/* * FlyObject.cpp * * * Created by Md. Alimoor Reza on 6/26/10. * Copyright 2010 Drexel University. All rights reserved. * */ #include "FlyObject.h" FlyObject::FlyObject(int area, pair centroid, pair majorAxisEV, pair velocityV,bool headIsInDirectionMAEV, pair head, double speed) { this->area = area; this->centroid = centroid; this->majorAxisEV = majorAxisEV; this->velocityV = velocityV; this->headIsInDirectionMAEV = headIsInDirectionMAEV; this->head = head; this->speed = speed; } FlyObject::FlyObject(const FlyObject &f){ this->area = f.getArea(); this->centroid=f.getCentroid(); this->majorAxisEV =f.getMajorAxisEV(); this->velocityV = f.getVelocityV(); this->headIsInDirectionMAEV = f.getHeadIsInDirectionMAEV(); this->head = f.getHead(); this->speed = f.getSpeed(); } int FlyObject::getArea() const { return area; } pair FlyObject::getCentroid() const { return this->centroid; } pair FlyObject::getMajorAxisEV() const { return this->majorAxisEV; } pair FlyObject::getVelocityV() const { return this->velocityV; } bool FlyObject::getHeadIsInDirectionMAEV() const { return this->headIsInDirectionMAEV; } pair FlyObject::getHead() const { return this->head; } double FlyObject::getSpeed() const { return this->speed; } void FlyObject::setArea(int area) { this->area = area; } void FlyObject::setCentroid(pair centroid) { this->centroid = centroid; } void FlyObject::setMajorAxisEV(pair majorAxisEV) { this->majorAxisEV = majorAxisEV; } void FlyObject::setVelocityV(pair velocityV) { this->velocityV = velocityV; } void FlyObject::setHead(pair head) { this->head = head; cout << "new head is set"<speed = speed; } void FlyObject::normalizeVelocity() { double temp = velocityV.first*velocityV.first + velocityV.second*velocityV.second; temp = sqrt(temp); cout << "sum = "<headIsInDirectionMAEV = headIsInDirectionMAEV; cout << "head flag set to "<headIsInDirectionMAEV<headIsInDirectionMAEV<head.first<<","<