Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trig Calculation....
Message
De
17/12/2003 13:03:03
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
17/12/2003 07:32:31
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00859407
Message ID:
00860001
Vues:
27
>>I agree it's very simple in principle - sketch an example on a scrap of paper and you can easily work out the correct values. I'm just finding it difficult to come up with an (elegant) algorithm to get the program to do the same thing...
>
>This looks like a maximum problem for me, which is usually solved with derivatives.
>
>The basic approach is to calculate the area in terms of a single variable (several variables are possible, but more complicated). In this case, it could be a length.
>
>Then, calculate the derivative of this function. The derivative is a second function that gives the slope of the first function.
>
>This is relatively easy; the main problem, IMO, is the first part: get the expression for the area, in terms of some length.
>
>First, you must define your restrictions (if any): for instance, whether the lines of the rectangle should be horizontal and vertical, or not.

Simpler - because the restriction is there, the sides of the rectangle are parallel to coordinate axes. So, for the top side, its height is
if between(90, angle1, angle2)
   top=radius + centerY
else
   top=max(point1y, point2y)
endif
Now for other four sides, just rotate the whole logic by a right angle. There may be a little consideration over the right side - whether we have negative angles or we have angles of more then 360. IOW, what's the format of the given data.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform