Jump to content

Worksheet Length of Rectangle


Recommended Posts

I have created a basic Worksheet to tell me the lengths of rectangles in a certain class.

I have used the Database tool.

The Equation line reads =width (in the header of row A)

This works fine for rectangles that are not at an angle but if I rotate the rectanlge the "width" is now the X length.

In other words if I have a rectangle measuring 1000x50

The result of the equation for Width = 1000

The result of the equation for Height = 50

If I then rotate the rectangle 45?

The result of the equation for Width = Height

Ive tried using the functions

-Length

-Width

-Height

but none seem to tell me the "length

of a rectangle that is rotated.

What am I doing wrong?

Link to comment

In a worksheet, you can use these formulas to calculate the object's boundary box :

=BOTBOUND

=TOPBOUND

=LEFTBOUND

=RIGHTBOUND

With a little trigonometry, you may get somewhere.

While we're at it, the new rotated rectangle is a new function in VectorScript as well :

RectangleN(x,y,cos,sin,height,width); (not sure if I have the parameters right)

so maybe there's a way to retrieve that information into a worksheet (although I haven't found that yet).

Link to comment

To the best of my knowledge, there are no calls that yield the LxW dimensions for new rotated objects when they are, or the plan is, rotated. I believe this to be true for VS and WkSheets.

In VS, it is possible to dissect the objects to get the values, but that is a tedious and error prone task. In WkSheets I think you'll have to wait until the powers-that-be provide for the masses.

The new functions let you set, but not retrieve values.

Raymond

Link to comment

Cos and Sin are both needed because they define the direction of the first segment of the rectangle.

With only a Cos, for example 0.5, you'll get two directions: 60? and -60?(300?). That's why the Sin is needed.

BUT: those two parameters are not the Sin and Cos. They are real values that defines the direction vector. the first is it's x component and the second is it's y component.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...