Constrained random points on a circle: Difference between revisions
Constrained random points on a circle (view source)
Revision as of 09:07, 14 September 2010
, 13 years ago→{{header|C}}
Line 13:
The general scheme is :
**1. All points satisfying the inequality are enumerated.
**2. 100 points are chosen at random from this set and plotted.
**3. To ensure that the same point is not picked twice and hence speed up the plotting, the chosen point is swapped with the last point after plotting. The new point is then chosen from the new set minus the last element. The position of this last element moves towards the head as the loop progresses.
<lang C>
Line 95:
Output will differ from system to system. A better rendering would be to use graphics libraries like OpenGL or Turbo BGI.
<
Line 127:
* **
* **
</
=={{header|D}}==
|