problem in creating a rectangle at a angle

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2004
Posts: 4
Reputation: aviral82 is an unknown quantity at this point 
Solved Threads: 0
aviral82 aviral82 is offline Offline
Newbie Poster

problem in creating a rectangle at a angle

 
0
  #1
Oct 6th, 2004
hi all,
i have to make a rectangle in c++.
The inputs are length,breadth,center point and the aspect angle.
The rectangle should be tilted at that angle
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 27
Reputation: fahad is an unknown quantity at this point 
Solved Threads: 0
fahad fahad is offline Offline
Light Poster

Re: problem in creating a rectangle at a angle

 
0
  #2
Oct 6th, 2004
Hi;
There is built in funtion in c++ for drawing a rectangle
U should include graphics.h as the header file
and call the function rectangle(int,int,int,int);

It takes four parameter as x1,y1,x2,y2 as the coordinates

For the angle U can calculate from the angle that what coordinates u have to give,,,,,,,,.

I hope that the problem is clear but if still there are some problems ask again......


Fahad
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 18
Reputation: Nuez_Jr is an unknown quantity at this point 
Solved Threads: 1
Nuez_Jr's Avatar
Nuez_Jr Nuez_Jr is offline Offline
Newbie Poster

Re: problem in creating a rectangle at a angle

 
0
  #3
Oct 6th, 2004
Take the points (1,1), (1,-1), (-1,1) and (-1,-1). Stretch the set to however wide/tall you need, then run all four through

x *= cos(a);
y *= sin(a);

It's the same principle as in the rotated-ellipse problem.
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: problem in creating a rectangle at a angle

 
0
  #4
Oct 7th, 2004
Hi there,

Per the terms of our forum, have you written any code yourself? We're not here to write code or do your homework for you-- you need to show effort of your own for us to help you more effectively.
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC