TAB

One of the works done by our Robotics and Machine Learning division,
SELF-LEVELING QUADCOPTER
Arduino based Quadcopter.
Self-leveling is acheived by the aligning the quadcopter using the readings from the gryo as well as the accelerometer.
A four channel RC transmitter is used to control the movement of the quadcopter when in flight. Kindly subscribe to our YouTube Channel and stay tuned.

Tuesday 8 March 2016

PRACTICE PROBLEM 4:vector

THIS IS A VERY IMPORTANT PROBLEM PLEASE MAKE SURE YOU UNDERSTAND IT COMPLETELY....
--------------------------------------------------------------------------------------------------------------------------
DETAILED  EXPLAINATION : HERE

========================================================================
istream& operator>>(istream& in,vector& v)
{
in>>v.num;
int i;
for(i=0;i<v.num;i++)
{in>>v.ele[i];
}
return in;
}
ostream& operator<<(ostream& in,vector& v)
{
int i;
for(i=0;i<v.num;i++)
in<<v.ele[i]<<endl;
return in;
}
vector vector::operator+(vector& v)
{
vector temp;
if(num>v.num)
temp.num=num;
else
temp.num=v.num;
for(int i=0;i<num;i++)
{
temp.ele[i]=ele[i]+v.ele[i];
}
return temp;
}
vector vector::operator-(vector& v)
{
vector temp;
if(num>v.num)
temp.num=num;
else
temp.num=v.num;
for(int i=0;i<num;i++)
{
temp.ele[i]=ele[i]-v.ele[i];
}
return temp;
}
int vector::operator[](int i)
{
return ele[i-1];
}

No comments:

Post a Comment