Giordano Bruno
Well-known Member
- Joined
- Jan 7, 2007
- Messages
- 1,345
I have found a UDF for triangular random number distribution and have worked out one for myself by imagining a rectangle containing the triangle and setting a position based on two random numbers, one for the x axis and the other for the y. If the location is outside the triangle, I adjust it so that it touches the slope of the triangle. Half of the hits are inside the triangle and half outside, but both generate a triangular distribution.
I am now trying to generate a random number for a truncated triangular distribution. I can do this by filtering out unsuccessful hits, but I need a result at each iteration. Any help would be most gratefully received.
I am now trying to generate a random number for a truncated triangular distribution. I can do this by filtering out unsuccessful hits, but I need a result at each iteration. Any help would be most gratefully received.