#include "popunit.h" #include #include #include #include #include inline Popunit::Popunit(double wcoord, double ncoord, int newpop, int a_name_num, string a_name): west(wcoord), north(ncoord), pop(newpop), name_num(a_name_num), name(a_name) {} Popunit::~Popunit(){} inline void Popunit::set(double wcoord, double ncoord, int newpop, int a_name_num, string a_name) { west = wcoord; north = ncoord; pop = newpop; name_num = a_name_num; name = a_name; } double Popunit::get_distance(const class Popunit& x) const { double netwest = x.west - west; double netnorth = x.north - north; return(sqrt(netwest*netwest + netnorth*netnorth)); }