Write a program to implement the motion of a bouncing ball
using a downward gravitational force and a ground-plane
friction force. Initially the ball is to be projected in to
space with a given velocity vector
Answers were Sorted based on User's Feedback
Answer / tsigereda
#include<dos.h>
#include<iostream.h>
#include<graphics.h>
#include<math.h>
#include<conio.h>
void *ball;
void image()
{
//ball
//setcolor(RED);
setfillstyle(SOLID_FILL,RED);
fillellipse(10,10,10,10);
//ball=malloc(imagesize(0,0,50,50));
//getimage(0,0,50,50,ball);
cleardevice();
}
void main()
{
int d=DETECT,m;
initgraph(&d,&m,"C:\\tc\\bgi");
float x=1,y=0.00000,j=.5,count=.1;
float r=15;
int l=getmaxx()/2,t=0;
image();
setbkcolor(GREEN);
setcolor(30);
line(0,450,650,450);
sleep(1);
for(int k=0;k<=7;k++)
{
for(float i=90;i<270;i+=10)
{
y=cos(((i*22/7)/180))/j;
if(y>0)
y=-y;
x+=5;
setcolor(14);
setfillstyle(1,14);
circle(x,y*200+400,r);
floodfill(x,y*200+400,14);
delay(100);
setcolor(0);
setfillstyle(1,0);
circle(x,y*200+400,r);
floodfill(x,y*200+400,0);
}
j+=count;
count+=.1;
}
getch();
}
| Is This Answer Correct ? | 11 Yes | 3 No |
Answer / tsigereda
which is animate downward gravitational force.
| Is This Answer Correct ? | 6 Yes | 1 No |
What is the hidden bug with the following statement? assert(val++ != 0);
Cluster head selection in Wireless Sensor Network using C programming language.
1 o 1 1 0 1 0 1 0 1 1 0 1 0 1 how to design this function format in c-language ?
Write a single line c expression to delete a,b,c from aabbcc
There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
write a origram swaoing valu without 3rd variable
struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above
Find your day from your DOB?
15 Answers Accenture, Microsoft,
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
How can i find first 5 natural Numbers without using any loop in c language????????