Find a point (x
,y
) on the permiter of a rectangle
the rectangle origin starts at some arbitrary x
, y
and is maxX
wide and maxY
high.
Solutions can be written in any lang, although I wrote mine in JS
Find a point (x
,y
) on the permiter of a rectangle
the rectangle origin starts at some arbitrary x
, y
and is maxX
wide and maxY
high.
Solutions can be written in any lang, although I wrote mine in JS
I'm still kind of a rookie but here's a long way using PHP
https://gist.github.com/devcircus/2a709f5dc6588d322fd89cf150cf2fb6#file-jakeschallenge-php
Hey Jacob. I don't understand the challenge. I'll take a stab at writing my understanding of the problem. Please correct me.
You are given minX, minY representing the lower left point of a rectangle. You are given maxX, maxY representing the upper right point of a rectangle. Write a function that takes these 4 parameters and returns a random point on the perimeter of the rectangle.
Your current code doesn't accomplish this but seems to be going in that direction. Correct me if I'm wrong in my understanding. Thanks so much.
https://gist.github.com/rankogit/4cbdc28c391452c1d61f09998b0f264a
Generates a random point on perimeter of a rectangle.
Instead of putting your solutions in the comments, create a new gist and link to your solution in here. Feel free to include your lang selection in your Link title.