943,376 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3078
  • C++ RSS
Oct 6th, 2004
0

problem in creating a rectangle at a angle

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
aviral82 is offline Offline
4 posts
since Sep 2004
Oct 6th, 2004
0

Re: problem in creating a rectangle at a angle

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
Reputation Points: 14
Solved Threads: 0
Light Poster
fahad is offline Offline
27 posts
since Sep 2004
Oct 6th, 2004
0

Re: problem in creating a rectangle at a angle

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.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Nuez_Jr is offline Offline
18 posts
since Oct 2004
Oct 7th, 2004
0

Re: problem in creating a rectangle at a angle

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.
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: program to compute that the area and perimeter
Next Thread in C++ Forum Timeline: challenging





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC