ADVERTISEMENT

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.

Wednesday 10 August 2016

CSE1002:PP2:IMAGINARY NUMBERS

#include<stdio.h>
#include <stdlib.h>

    int x,y,x1,y1,fx,fy;
int main()
{
  scanf("%d\n%d\n%d\n%d",&x,&y,&x1,&y1);
  add();
  print();
  sub();
  print();
  mul();
  print();
}
void add()
{
    fx=x+x1;
    fy=y+y1;
   
}
void sub()
{
    fx=x-x1;
    fy=y-y1;
}
void mul()
{
    fx=x*x1-y*y1;
    fy=x*y1+y*x1;
}
void print()
{
    if(fy==1)
    printf("%d+i\n",fx);
    else if(fy==-1)
    printf("%d-i\n",fx);
    else
    printf("%d%+di\n",fx,fy);
}

No comments:

Post a Comment