-1

Let's say I have a rectangle of width w and height h centered at coordinate origin. How I can create rhombus described on this rectangle? Additional requirement is that rhombus width should be twice as height. Any ideas?

user3848246
  • 127
  • 1
  • 5

1 Answers1

0

Clue: you need that rectangle corner point (w/2, h/2) belongs to segment (0, a)-(2*a, 0).

So write line equation for this segment, substitute corner coordinates into that equation, solve it for unknown a parameter (half of vertical diagonal of the rhombus)

MBo
  • 77,366
  • 5
  • 53
  • 86