My Math Forum  

Go Back   My Math Forum > High School Math Forum > Geometry

Geometry Geometry Math Forum

LinkBack Thread Tools Display Modes
September 28th, 2015, 10:22 AM   #1
Joined: Sep 2015
From: office

Posts: 1
Thanks: 0

question in regards of generating a set of random triangles


I hope this is the right forum and the right section.

Let's assume I have the following given:
- a rectangle with a given length and height
- a number of triangles I want to place in it
- a value specifying how random the size of the triangles should be (for example from 0 to 1, where 0 is all of the same size and 1 means the size is set randomly between 0 and the entire available area)

I now want to fill said rectangle with the set amount of triangles. So I want to calculate the corner points of the triangles. They should fill up the entire space, never overlap, and vary in size within the given amount.

So far, I did it like that:
According to the number of triangles needed, I calculated a number of rows and columns that end up with roughly half the amount of rectangles than triangles needed. Next I'd move around the corners of those rectangles in some way, to get the desired randomness. Then I'd basically divide those rectangles to end up with triangles.

Advantages of this method:
- straight forward
- ensures that the triangles do not overlap

- you will rarely end up with exactly the right amount of triangles (though this is not a must-have, it would be nice)
- the triangles still show roughly the square pattern, since I can't move them too much around randomly, since they'd otherwise overlap

Is there a better way to achieve this?

Another idea I had in mind would be this:
Depending on the amount of triangles needed, I'd scatter points at random over the available area. Then I'd add also add points on the borders of the area. Now I'd iterate through each point, and connect it to the three closest dots.

- generates the exact amount of triangles needed
- gives you far more freedom in matters of how the triangles are placed, they are not bound to a grid anymore

- I'm not sure whether this method really ends up with triangles that do not overlap
- generating triangles of a certain minimum or maximum size wouldn't be too easy. I assume that, whenever placing a new point, I'd have to calculate the distance to the other nearby points, to ensure it wouldn't be too large, and in case of doubt move it. But this seems inefficient.

Anyone got any idea?

Gabla is offline  

  My Math Forum > High School Math Forum > Geometry

calculation, generating, positioning, question, random, randomness, set, triangles

Thread Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Homework help - Generating random variable ricolinka Algebra 1 February 9th, 2014 11:11 AM
Similar triangles question Chairmanpeaches Algebra 1 December 4th, 2013 07:35 PM
Generating functions question D345 Advanced Statistics 2 August 18th, 2011 05:25 AM
question on similar triangles. siddharth Algebra 4 May 21st, 2011 12:55 PM
Probability of generating a repeat random number... jsulliva83 Algebra 0 May 6th, 2009 08:34 AM

Copyright © 2019 My Math Forum. All rights reserved.