CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@sumit_goel • 16 Aug, 2010
hello friends,
I have another problem that is how to rotate the line at 90 degree from the origin.
for example, i have a line x,y

__________________
x.......................... y
and now i want to rotate this line at 90 degree as shown bellow

90
|
|
|
|
|
|
|
|
X

rotation at 90 degree

Pls help me in solving this problem
@gaurav.bhorkar • 17 Aug, 2010 Can you post the code you've tried so far?

Here's my suggestion,
Fix one end of the line and then change the coordinates of the other end appropriately.
@optimystix • 17 Aug, 2010 what is the problem ? just substitute the corresponding values for 90 degree in the rotational transformation matrix and solve it.
where are u facing the problem ? share with us so that we can help.
@Manish Goyal • 17 Aug, 2010 Try bresenham algorithm
change the coordinates of line accordingly
@sumit_goel • 18 Aug, 2010 Hello friends
first of all i would like to thanks to all for giving response to my problem. Actually i made a table fan in c++ and i want to rotate the fan. but for this first of all i should know how to rotate the line. then i can proceed to make rotation of fan.In the above problem i simply want to ask how to rotate the line at 90 degree.I am beginner of graphics programs in c++. and also Can anyone tell me from which site i can learn simple graphics programs in c++.
@Manish Goyal • 18 Aug, 2010 Try this program but i have not execute this .
It will draw a line
Now for rotating it change its co-ordinates accordingly
```#include  <graphics.h>
#include  <math.h>
#include <conio.h>

void main(void)
{
int   driver = DETECT,mode;

int   x=180,y=180;

initgraph(&driver,&mode,"c:\\tc\\bgi");

for(;;)
{

line(360,360,x,y);

}
getch();
closegraph();
}```
5k views

## Related Posts

@Ankita Katdare · Aug 7, 2013

Hyundai Motor India Ltd, India’s second largest passenger car manufacturer, has launched Hyundai Grand i10. Setting the small car market on fire, this new ride vehicle from Hyundai which happens...
7.4k views

@Ankita Katdare · Sep 6, 2011

Find out the number that should be place inside this circle:
21.2k views

@Ankita Katdare · Nov 24, 2013

I was earlier today discussing with a friend about the general trend followed by students in engineering colleges in India when they are in final year or final semester. They...
14k views

@Satya Swaroop Dash · Jan 18, 2014

Huawei has launched four new smartphones in the Indian market. It has expanded its Ascend line of Android smartphones with the launch of Ascend G700, Ascend G610, Ascend Y511 and...
4.3k views

@Muhibullah · Sep 20, 2012

I'm studying automobiles and have a very basic question - What is the function of 'gear' in a vehicle?
10.1k views