Calculating sin and cos

Hello i am trying to calculate at where a pixel should be moved to based on a given angle.
The angle is 90, here is the formuala.
Is this correct, do i need to change the angle (in degrees) to radians before I calcualte its sin and cos.
          int x = (int)Math.round(
                        ((tempCol) * (Math.cos(Math.toRadians(-90))))
                        + ((tempRow) * (Math.sin(Math.toRadians(-90))))
                        +  centroid.col);Thanks

cross-post
http://forum.java.sun.com/thread.jsp?forum=31&thread=379839

Similar Messages

  • How to graph sin and cos function on grapher?

    Hello,
    I am needing to graph this function on grapher, but can't (obviously, it's without the questinon mark). 
    All I get is this and no graph. :
    Can anybody tell me how to get the actual sin wave on the graph?
    Thanks!

    Here's how to animate a point along a graph. In this screenshot, we have the first function show the expected sine curve. The second function is a pair of values, defining x and y each as functions of "n" and then plotting the pair. Since x and y in this definition takes on one value at a time (and no range), you get a point. To animate the graph, you define "n" as a separate function (create a new function, delete the "y=" and replace with "n="). To make this a smooth evaluation of all points, click "n" to give it a value, and then press Option-Command-A to invoke "animation". You can then click the icon with checkmarks and two lines (to the far right seen here), and set the range for "n" along with subdivisions, or continuous values. You can then drag the slider to change the value for n, enter a specific value in the value box, or click the play button to animate back and forth.
    Note that in this screen shot, to in part answer the original poster's question, I've defined "f(x)" as the function "sin(x)" and then to display the function, since grapher plots y as a function of x, I've set y=f(x) so this behavior can be drawn. Its redundant, but allows for the management of functions in some ways that might be useful. For instance, you could do a set of functions such as the following:
    f(x)=x
    g(x)=x^2
    h(x)=x^3
    ...and then plot them all with y={f(x),g(x),h(x)}.
    In this instance, since the graphs are all increased powers of x, you can follow this trend by plotting over a set of values:
    set={1,2,3,4,5}
    f(x)=x^set
    This will plot x^1, x^2, x^3, x^4, x^5, etc...and you can also throw an "n" value in the set, then animate it, so some of the functions remain static while others are animated by the value of "n".
    ....the possibilities are vast.

  • Sine and Cosine calculations

    I need to convert Double Precision Floating Point numbers by taking the Sin and Cosine. I have found that the calculations give inconsistant answers. For instance Cos(90) = 6.123(incorrect) and should be 0, Cos(0)=1 (correct). I tried in degrees and radians.I use labview 7 with XP professional OS.

    You see the fundamental problem is that all floating point representations are approximations. Consequently, it is rather easy to come up with calculations that give "wrong" answers. As folks have pointed out you need to always be mindful of the numeric precision that is available -- and that can be trusted. And when working with calculated values never test for absolute equality.
    On a related track, you also need to be mindful of the results from "invalid" calculations that can return so-called pseudo-values like not-a-number and positive or negative infinity. These values can cause all sorts of mischief.
    And then there's the ever-popular negative zero (-0)...
    Mike...
    Pocket Calculator: (n) An electronic device capable of dividing a ballpark estimate by a wild-ass guess and returning a value accurate to 13 decimal places.
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • WIP and COS calculation in Project Systems

    I am trying to determine WIP and COS using KKAJ.  WIP always returns 0 while COS returns the totaled planned cost as COS.  I cannot figure out why this is so.  Any ideas what I should change to correctly calculate COS and WIP?  I have already maintained a result analysis key.

    Hi,
    Posting to FI happens during settlement and you need to maintain the "posting rules" for this in RA configuration. As for WIP calculation, it should happen during RA itself. You should be able to see the calculated costs, calculated revenue etc during RA (KKA2 or kKAJ). The same will be used during the WBS Settlement. And the calculation need not wait until TECO. Check the valuation method settings for status dependant settings.
    Regards
    Sreekanth
    Edited by: Sreekanth P S on Sep 20, 2011 3:06 PM

  • How to monitor progress of web-service calculation?  And abort it?

    Hello. We're thinking of converting an existing Java radar calculation program into a web-service, so that it can be used by various interested parties. However, calculations can take some time (several minutes) and so we would like the client to be able to both show calculation progress and allow the user to abort the calculation if necessary. It is not obvious to us how to do this with a web-service. Are there any standard approaches to this problem? What's the best way of a client asking the web-service how a calculation is progressing? What's the best way for a client to abort a calculation? Any advice most welcomed.
    Kind regards
    Paul Howland
    NATO C3 Agency
    The Hague

    You can't estimate the duration withour running the gather_database_stats. You can monitor it while it is running. (e.g. count the tables that have got updated statistics based on DBA_TABLES)
    And if you run gather_database_stats, the default behaviour might well be to exclude tables which aren't "stale" while in the imported database the expectation is to gather stats on all tables.
    (Similarly, the behaviour to gather column histograms (method_opt) may differ in an existing database from a newly imported database)
    Hemant K Chitale
    Edited by: Hemant K Chitale on May 14, 2013 10:13 AM

  • Function module for calculating planned and actual cost of production order

    Hi ,
    Do we have any standard function module for calculating planned and actual cost for production order?
    i need to implement this in a Z-report.
    Thanks
    Srini

    Hi,
    try below function module
    CRMCO_GET_PLAN_ACTUAL_COSTS
    CO_IH_GET_PLANNED_COSTS_TOTAL
    Regards,
    Sankaran

  • Calculating opening and closing stocks at a plant (on specific dates)

    Hi,
    I am to develop an ABAP-report. On the selection screen, I'll have plant, material, and a date range (date_1 and date_2). The report should show opening stock on date_1, closing stock on date_2, and then there is more segregation based on movement types (along with both stock-quantity and stock-value). I am stuck at how-to's around calculating opening (and closing) stock on a particular date.
    Secondly, transaction MB5B has 3 options : batch stock, valuated stock, special stock ... One of these options uses table MBEW and other uses table MARD ... Which (all) tables will I need to use so as to get both stock-quantities and stock-values ?
    Please advise. Thank you.
    Regards,

    Hi
    for second question answer is
    you need to consider all batch stock, valuated stock, special stock ... One of these options uses table MBEW and other uses table MARD to get both stock-quantities and stock-values
    hope it helps
    Edited by: ppkk on Dec 10, 2008 10:58 AM

  • Can I generate sine and square waves with NI PCI-MIO-16XE-50 card??

    Can I generate sine and square waves with NI PCI-MIO-16XE-50 card??
    How Do I generate those signals?

    Hello;
    You certainly can do that. The way to go about that is to use one of the Analog Output channels your board have available.
    If you are using Labview to program the board, you can find good examples at Search Examples->I/O Interfaces->Data Acquisition->Analog Output->Multiple Point (buffered) Analog Output.
    If you are using other Software language to program the board, you can fing examples at C:\Program Files\National Instruments\NI-DAQ\example\VisualC\AO.
    Hope this helps.
    Filipe

  • I Can't lock an entity that has "OK" calculation status and "Published" review level

    The problem into the HFM aplication is that I have to lock the actual period but one entity has "OK" calculation status and "Published" review level; when I clic "lock" on the entity, the system send a message "The process Unit cannot be locked if it needs to be calculated, translated, or consolidated"
    Thank you

    Check the Other Value dimensions.  Locks are value specific(So locking Entity Currency doesn't necessarily lock Parent Currency).  Make sure all the value dimensions are at OK status.

  • Alternative calculation type and alternative condition base value

    In pricing procedure what is the difference between alternative calculation type and alternative condition base value?Kindly help

    Hi,
    Please check the forum before you post your questions as this question was answered a number of times earlier.
    Please check the below link which discusses in detail regarding the same.
    [Alt Cal Type and Cond Base Value|Alternative calculation type and alterantive condition base value in pricin;
    Regards,
    Phani Prasad

  • Requirement type, alternative calculation type and alternative base value?

    Hi guys pls can any body experts in pricing
    Can u pls explain requirement type, alternative calculation type and alternative base value?
    Not theory Any of Ur real time experience………

    <b>Requirement:</b>
    It is a routine that is written by an ABAP consultant according to the business requirement.
    By defining Requirement in condition technique we can restrict the access of condition type.
    To understand the concept, we will take the example of the Rebates. Rebates are to be included during the billing document processing and not in the sales document processing. As rebates are given on the delivered quantity and not on the ordered quantity (in case of cut-off period for rebates).
    For rebates we use the condition types BO01 to BO05, and in the Requirement column we give the value 24 which is "Only in Billing Document".
    This Requirement will ensure that these condition types will appear only during the billing document processing.
    If new Requirements are to be defined we follow the procedure given below.
    Go to T.Code: VOFM. - Maintain Requirements & Formulas
    Click on the "Requirements" in the top menu and then click on "pricing".
    We have a list of requirements, we can ask ABAP consultant to create new requirement based on the client requests.
    And we assign the application type like V - Sales/Distribution etc.
    <b>AltCty - Condition formula for alternative calculation type:</b>
    It is again a Routine that is written by ABAP Consultant.
    It is an alternative formula for the condition type that can be used instead of standard formulas.
    For example, let us take the Profit Margin which can be both + / - , so here this routine will help us in generating the value which can be either + or -. Profit margin is not a condition type so it cannot be classified as +ve or -ve in the V/06.
    Ex.: 950 0 Profit Margin 11.
    So we assign 11 - Profit Margin.
    If new routines are to be defined we follow the procedure given below.
    Go to T.Code: VOFM. - Maintain Requirements & Formulas
    Click on the "Formulas" and then on the "Condition Values".
    We have a list of routines, we can ask ABAP consultant to create new routines based on the client requests.
    And we assign the application type.
    <b>AltCBV - Alternative formula for condition base value:</b>
    Formula for determining the condition basis as an alternative to the standard.
    It is again a Routine that is written by ABAP Consultant.
    It is used as a basis to calculate value of the condition type instead of using it from the "FROM" column.
    Ex.: Freight - KF00.
    Freight is calculated based on weight, volume etc. and not on the base price. In pricing there is no entry of weight from which the value can be referred like we do for discounts using base price. We have to get the value from the Material master.
    In this column we can mention the value as 12 - Gross Weight or 13 - Net Weight.
    During pricing, the system will consider the value that is mentioned in this column and determine the freight based on this value.
    Suppose we have Net weight: 100 kgs and Gross Weight: 150 kgs. And if we mention 13 in this column then the Freight condition KF00 will be calculated using the weight as 100 kgs.
    Regards
    AK

  • Alternate calculation type and alternate base value

    hi all,
    please guide me the concept of alternate calculation type and alternate base value

    Hi,
    ALTERNATE CALCULATION TYPE:  
          This  function allows you use a formula as an alternative in finding the value of the  condition type,
    instead of standard condition technique. this can be used to  calculate complex tax structures. 
    ALTERNATE CONDITION BASE VALUE:
          The  alternative condition base value is a formula assigned to a condition type in  order to promote an alternative base value for the calculation of a  value.
    And Refer this link.
    http://sapsdforum.com/2007/09/05/pricing-alternate-calculation-type-alt-condition-base-value-and-requirements/
    Hope it helps you,
    Regards,
    Ravindra.

  • QoS - can u trust dscp and cos?

    Hello,
    is it possible to trust DSCP and COS at the same time?
    If so, which one wins?

    G'day,
    It does not really make sense to trust both DSCP and CoS at the same time. You configure your switch to trust one or none of these.
    As an example, if you did have the capability to trust both DSCP and CoS, imagine what would happen if you received a frame with DSCP EF and CoS 0 ? You would be faced with a conflicting situation ... if you trusted CoS, you would give a potentially high-priority packet lesser service. Whereas if you trusted DSCP, you could end up giving a potentially low-priority packet voice-like service... So the option of trusting both is not allowed.
    Hope that helps - pls rate the post if it does.
    Paresh

  • When we use calculation script and when we use business rule

    when we use calculation script and when we use business rule can anyone please tell me

    Re the OP's question, here is an excellent introduction to Calculation Manager and business rules. It was the first hit when I googled "calculation manager hyperion".
    http://ranzal.wordpress.com/2010/06/11/oracle-hyperion-calc-manager-%E2%80%93-part-1/
    You can also go to odtug.com -- the Tech Resources section has a series of presentations on Calculation Manager, from beginner to intermediate.
    The added benefit with business rules are that you can use variables and runtime prompts. You can also link planning with business rules and pass information from a web form into a business rules.^^^Only with Planning. There are no runtime prompts with Essbase in 11.1.2.2 but I hear it is coming back in 11.1.2.3
    We can use Business Rule for all applications and it is GUI.^^^Doesn't have to be GUI-based. You can (depending on version) flip back and forth between GUI and script. I have not tried writing (nor can I actually think why you would want to do this) a Calc Mgr rule for multiple apps. Maybe you are thinking of a script object that can be called multiple times?
    To check whether a calc script is executed or not you have to use the Essbase application database log file (Plan1.LOG)^^^As business rules are, sooner or later, translated to BSO (and hey, ASO too and HFM and Fusion and HPCM and they can differ, a lot, so this is not always true) calc script language, you can always check in the application log to see what is run if Planning or BSO Essbase.
    Regards,
    Cameron Lackpour

  • DSCP and CoS mapping to use uAPSD

    Hi CISCO experts, I'm trying to map some traffic to a DSCP and CoS priority. The fact is that doesn't work.
    Steps:
    1.Set personal filter (myfilter)to forward from specific IP.
    2.Set QoS policy: my_policy --> myfilter-CoS (4).
    3. Add policy to 802.11g.
    When I look up the IP traces DSCP is allways 0x00 (Best Efford).
    If I map DSCP (best efford) to DSCP (vocie) doesnt work either.
    What can I do? Im trying to emulate AC_VO or AC_VE so I can force the uAPSD protocol to work.
    Best regards

    Are you using a Cisco WLAN controller or autonomous AP?
    You would need to ensure that the RTP (voice) packets to the AP has DSCP = EF.
    There is an auto policy in the WLAN controller to map EF to UP6.
    For autonomous, will need to create a QoS policy to do this.
    But you do not want to map DSCP = 0 to UP6!
    This defeats the purpose.
    Will only want RTP packets to be marked as EF.
    See the WLAN SRND and 7921G Deployment Guides for more info.
    http://www.cisco.com/application/pdf/en/us/guest/netsol/ns279/c649/ccmigration_09186a00808d9330.pdf
    http://www.cisco.com/en/US/docs/voice_ip_comm/cuipph/7921g/5_0/english/install/guide/7921dply.pdf

Maybe you are looking for