Math.cos result WAY off

I have a function that takes an angle in degrees and converts
it to radians. From there it takes the cosine of that angle and
multiplies it by another number. The problem is the result of the
Math.cos is way off.
The first line of code is this:
var theAngle = Math.abs(myAngle)*Math.PI/180;
myAngle is = -90. the result is that theAngle becomes
1.5707963267949.
From there I have this line of code:
var objAcc = grav * Math.cos(theAngle);
note that grav is set to .45. I've double checked in the
debugger and theAngle is still equal to the above listed number.
So, the result SHOULD be that objAcc should be equal to
-1.5711675124992e-15. HOWEVER, it is actually being set to
-1.72286501471525e-1. Is there something I don't know about working
with Math.cos? If I run the function and put in the number itself
instead of a variable it works out fine. It's just that when I have
the variable in there it screws it up.

just below your definition of objAcc, what's the following
reveal:
trace(grav);
trace(theAngle);
trace(objAcc);

Similar Messages

  • Strange results from Maths.Cos()

    Good day to all, I have 2 questions about using maths.cos() in Java
    1) is it possible to write the below written formula to calculate Cosine into Java? Instead of the given maths.cos()
    http://img.photobucket.com/albums/v670/davisli/cosine.jpg
    I managed only to calculate using Maths.cos()
    double x;
    x= Math.cos(Math.toRadians(d));
    However, it cannot add the number of terms into calculation. Where I had learnt, more number of terms added into cosine calculation, the more accurate answer it will give.
    2) Strangely, when I tried to do
    x= Math.cos(Math.toRadians(90));
    x= Math.cos(Math.toRadians(270));
    The answer displayed is not 0. Cosine 90 and 270 should be 0 right?
    Many thanks in advance.

    However, it cannot add the number of terms into
    calculation. Where I had learnt, more number of terms
    added into cosine calculation, the more accurate
    answer it will give.
    If Math.cos() uses the same algorithm as StrictMath.cos() (which it doesn't need to), a polynomial of degree 14 is used. Calculation of cos(x) is first reduced to calculating cos(y) where y is in the interval from -pi/4 to pi/4. The polynomial gives a prettty good approximation there. Then the value from the polynomial is correcteded slightly before returning. Adding more terms wouldn't yield a better result considering the fact that our merely finite computers can't handle exact arithmetic.
    By the way, consider that the approximation of pi/2 that Math.toRadians(90) gives is pi/2 plus or minus a number of the order of 1E-16 (0 point 16 zeroes and 1) and from Math.cos you get a number that is much closer to 0 than that. Math.cos() is actually giving you a better approximation than you are feeding in it!!!

  • Math.cos Math.sin = Math.HELP

    Hello Everyone,
    I was hoping to create a JS script to move objects away from common center based upon their current position. I was thinking to use a single selected path item as the center based on its position x/y and width/height. Using this reference point the script would then move away all other path items from this center point based on a desired amount and with uniform increments given their current location from this center. I was thinking cos and sin would be my friend in this case, however they seem to have become my foe instead. ;-)
    Does this sound doable? What am I missing, doing wrong, misinterpreting? Below is a non-working attempt, I can't seem to sort things out, perhaps I was close and missed it or maybe I am super way off and its more complex than I thought. However at this point I am confused across my various failed attempts this only being one of them.
    Thanks in advance for any assistance and sanity anyone can provide.
    // Example failed code, nonworking concept
    var docID = app.activeDocument;
    var s0 = docID.selection[0];
    pID = docID.pathItems;
    var xn, yn;
    var stepNum = 20;
    for (var i = 0; i < pID.length; i++) {
        var p = pID[i];
        var dx = ((s0.position[0] + s0.width) / 2 - (p.position[0] + p.width) / 2);
        var dy = ((s0.position[1] + s0.height) / 2 - (p.position[1] + p.height) / 2);
        xn = Math.cos(Number(dx) * Math.PI / 180)+stepNum;
        yn = Math.sin(Number(dy) * Math.PI / 180)+stepNum;
        var moveMatrix = app.getTranslationMatrix(xn, yn);
        p.transform(moveMatrix);
        stepNum+=stepNum;

    Hi W_J_T, here's one way to do what I think you want to do, I commented out the step increment so all items will "explode" the same distance, not sure if that's what you need.
    first I'd move the calculation of the Selected object's center out of the loop, you only need to make the math once.
    also, (s0.position[0] + s0.width) / 2  has a problem, it will not give you the center, check below
    // calculate Selection center position
    var cx = s0.position[0] + s0.width/2;
    var cy = s0.position[1] + s0.height/2;
    then we're going to loop thru all items and calculate their center
            // calculate pathItem's center position
            var px = p.position[0] + p.width/2;
            var py = p.position[1] + p.height/2;
    we're going to skip calculating the distance from the selection's center to each item's center, we don't need it for this method, other methods could use this info.
    now, your actual question about Sin/Cos
    xn = Math.cos(Number(dx) * Math.PI / 180)+stepNum;
    sin(angle) and cos(angle) expect angles in Radians, you are not providing any angles in the formula above. We need to calculate the angle between Selection's center and each path's center
            // get the angle formed between selection's center and current path's center
            var angle = get2pointAngle ([cx,cy], [px,py]);
    once we have the angle we can apply it to our "Explosion" variable, I'm assuming is stepNum, and get its x and y distance it needs to move away from selection
            // the distance to move is "stepNum" in the same direction as the angle found previously, get x and y vectors
            var dx = stepNum*Math.cos(angle);// distance x
            var dy = stepNum*Math.sin(angle);// distance y
    all is left to do is move the paths, here's the whole thing
    // Explosion, AKA move all items away from selection
    // carlos canto
    // http://forums.adobe.com/thread/1382853?tstart=0
    var docID = app.activeDocument;
    var s0 = docID.selection[0];
    pID = docID.pathItems;
    var stepNum = 20; // this is the distance to "explode"
    // calculate Selection center position
    var cx = s0.position[0] + s0.width/2;
    var cy = s0.position[1] + s0.height/2;
    for (var i = 0; i < pID.length; i++) {
        var p = pID[i];
        // skip selected item
        if (!p.selected) {
            // calculate pathItem's center position
            var px = p.position[0] + p.width/2;
            var py = p.position[1] + p.height/2;
            // get the angle formed between selection's center and current path's center
            var angle = get2pointAngle ([cx,cy], [px,py]);
            // the distance to move is "stepNum" in the same direction as the angle found previously, get x and y vectors
            var dx = stepNum*Math.cos(angle);// distance x
            var dy = stepNum*Math.sin(angle);// distance y
            var moveMatrix = app.getTranslationMatrix(dx, dy);
            p.transform(moveMatrix);
            //stepNum+=stepNum;
    // return the angle from p1 to p2 in Radians. p1 is the origin, p2 rotates around p1
    function get2pointAngle(p1, p2) {
        var angl = Math.atan2(p2[1] - p1[1], p2[0] - p1[0]);
        if (angl<0) {   // atan2 returns angles from 0 to Pi, if angle is negative it means is over 180 deg or over Pi, add 360 deg or 2Pi, to get the absolute Positive angle from 0-360 deg
            angl = angl + 2*Math.PI;
      return angl;

  • Canon 5D Mark II Standard Profile - way off (reds)

    This could also be in the Lightroom forum, but here is probably the better place.
    I have always noticed that of all the cameras I ran through LR/ACR the Standard profile for the Canon 5D Mark II is way off in terms of reds. This mostly shows in shots that are underexposed and have tungsten light.
    Adobe's Neutral profile is way closer to Canon's Neutral Picture Style. Adobe's Standard profile can yield very unpleasing skin tones with a red-orange cast that's at its worst in the shadow zones.
    Here are some examples. ACR and DPP have Exposure set +1 and White Balance to "as shot".
    ACR is in its default settings (Blacks 5, Brightness +50, Contrast +25, Medium Contrast Tone Curve).
    DPP has the black point set to -4 to give a similar amount of shadow contrast.
    Please note that on a browser without color management this might not look right and you might need to download the images.
    ACR 6.1, Standard profile
    DPP 3.8.2 Standard Picture Style
    ACR Neutral profile
    DPP Neutral Picture Style
    Thomas

    Yes, and I know what WB is also.  And I know that different raw converters interpret the "as shot" wb exif data differently, and therefore there is no reasonable way to compare results without an explicit wb on a neutral object in the image within each raw converter.
    I believe that in order to do valid comparisons among the different raw converters one should prepare a test image including a known reference, preferably the color checker chart.  The raw image can then be run thru each converter with the first step being to wb on the second brightest neutral patch, and then (and IMO only then) one can do reasonable color assessments.
    Richard Southworth
    Added by edit - oops, I see Jeff jumped in, sorry to be redundant.

  • Apple watch workout is way off on calories

    I've used the apple watch workout app and the approximate calories burned is way off from what it should be. Is there any way to calibrate it so it will be more accurate? It shows only about half the calories burned that I know it should be.

    Hi poolmanrob,
    Yes, there is a way to calibrate your Apple Watch to improve the results shown in Workout and Activity.  By following the steps in the article linked to below, your Apple Watch will then be calibrated.
    Calibrating your Apple Watch for improved Workout and Activity accuracy - Apple Support
    I also recommend going through the best practices outlined below to ensure you get the best Workout measurement.
    Get the best measurement
    Your Apple Watch will estimate your measurements during workouts based on the information that you entered during setup, but you can further improve its accuracy using these tips:
    Wearing your Apple Watch regularly can improve the accuracy of the Activity and Workout apps.
    Choose the Workout that best matches what you’re doing. For example, if you're running on a treadmill, choose Indoor Run.
    For GPS accuracy when you walk, run, or cycle outdoors, select the appropriate Workout and bring your iPhone. This will also help calibrate the accelerometer in Apple Watch for times when you don’t have GPS, such as during treadmill workouts or when you're running outside without your phone.
    To get the most accurate heart rate measurement when you use Workout, make sure your Apple Watch fits snugly on top of your wrist. The heart rate sensor should stay close to your skin.
    You can also use another heart rate monitoring device, such as a chest strap. To pair an external heart rate monitor with your Apple Watch, tap the Settings app on the Home screen, then tap Bluetooth and select it under Health Devices. Learn more about the Apple Watch heart rate sensor, its accuracy, and its limitations.
    Use the Workout app on Apple Watch - Apple Support
    Have a good one,
    Alex H.

  • Cropping at angle is not accurate.... Way off!!

    My neighbor brought a problem to me which I could not solve. He is running Photoshop CS3 10.0.1 on XPSP2. When he crops something at an angle, the resultant image is way off -- it is not what is within the crop mark. Any idea what is happening here?
    I have CS2 and it works fine for me.

    It is a crop tool bug that has been around
    b for freakin' ever.
    If you rotate your crop marquee AND resample (down sample) you can get a distorted image that does not follow the crop lines.
    Use real units of measure in the crop setting (inches, cm... NOT pixels) or leave blank, and leave resolution blank. Resize the image after you rotate+crop.

  • Macbook Pro to TV via HDMI - image way off center

    Early 2008 15-inch Macbook Pro to TV via HDMI worked at first, now image is way off center on TV (like only showing a sliver of the computer image at the edge of the TV screen). Philips says it's an issue with the computer settings, not the TV. Any suggestions?

    Hello clamb1993,
    Thank you for using Apple Support Communities. 
    You can use the following article to troubleshoot your HDMI out connection:
    Apple computers: Troubleshooting issues with video on internal or external displays
    Regards,
    Jeff D. 

  • Getting error message that states itunesexe has been set to run in compatibilty mode for an older versions of windows for best results turn off compatibility mode for itunes before you open it .How do i turn off compatibility mode?

    recieved error message that states" itunes exe has been set to run in compatibility mode for an older versions of windows for best results turn off compatibility mode for itunes before you open it. How do i access compatibility mode and turn it off ? Believe i have Windows 7.

    Try the following document, only be sure that none of the boxes in the compatibility tab are checked (not just the compatibility mode box itself): 
    iTunes for Windows: How to turn off Compatibility Mode

  • I have macbook pro running on 10.9.2 every time i download music files and transfare the it duplicates the file is there any way off switching it off please help

    i have macbook pro running on 10.9.2 every time i download music files and transfare the it duplicates the file is there any way off switching it off please help

    Open Automator
    Choose Folder Action for type of document
    At the top, for Folder action receives files and folders added to, select Other...
    in the window that opens, select your Downloads folder, and then Choose
    from the Actions on the left, drag Filter Finder Items over to the column on the right
    Where it says Any Content, select Kind
    Where it says Any, select music
    Drag Move Finder Items over to the rightfor To: select other, and navigate to your user folder > Music > iTunes > iTunes Media > Automatically Add to iTunes
    it should look like this:
    close the window and give the folder action a name.

  • Preview fine in Safari but WAY OFF in Firefox, Flock, Opera....

    This is really frustrating me because I can't seem to get the pages to look the same in every browser.  I don't have IE (I have a Mac) so I have no idea what it looks like...  Please help if you can. 
    The page is located: http://www.promarevents.com/VA/work.html
    The css is located: http://www.promarevents.com/VA/va1.css
    Here are some screenshots of what is going on:
    Safari, this is how it should look...
    This is Opera.  The image is pushed down and the text runs off the layer.  The same exact thing is happening in Flock and Firefox....
    Flock having the same look.
    I tried changing the code so it looked good in Firefox and Opera, but then Safari was way off...  I received the files from a friend who wants me to make some "minor" changes but this is frying my brain!  Thanks!

    AlieneGirl,
    Not having looked closely into the CSS, it seems that something in the background has an excessive fixed width, and the VA logo with the gradient seems to be centred in it, whereas the box is locked to the right edge.
    If you use a sidebar and change its width, more and more of the VA logo becomes visible as the available width on screen is decreased.

  • Changed Pressure transducers with 0-5Vdc from the old 0-10. PVis way off!

    Im a newby with labiew as of last week. I was tasked to change the range of new pressure transducers that were recently installed in our lab application. I am currently running 6.1 with Fp-PS-4 , FP-1601 , FP-AI-112 , and FP-RTD-124 Hardware. We are changing over from Omegadyne model PX02C1-015AV to swagelok's S-model, output 0-5, Supply V dc= 10-30 V. The pinout on the connector has already been changed and tested. I also changed the range on the points of change to 0-5 and the pv is reading way off. Im sure there is a scale in a block diagram chart somewhere, but I cannot locate it. Can anyone point to any areas where I may make these changes to correct this problem?

    Hi Dano,
    You might check the Channel Configuration settings in Measurement and Automation Explorer (MAX). Under Remote Systems, expand the I/O modules underneath your 1601. Once you click on the I/O module that you are reading your transducer on, you'll see in the window to the right a Channel Configuration tab. Here, you can check the Data Configuration setting for the input Range. Make sure this is set to the expected signal range from your sensor.
    Cheers,
    Emilie K. | Applications Engineer | National Instruments
    Attachments:
    max fp channel config.jpg ‏38 KB

  • JPG and TIFF colors in Bridge CS5 way off, but fine in Photoshop

    Just started happening, but not sure if it was after updating to Bridge 4.0.3 or Camera RAW 6.2.  The colors for RAW and PSD files are fine in Bridge, but all JPGs and TIFFs colors are blown out and way off.  Opening the JPG or TIFF in Photoshop looks fine though.  Anyone else having this issue, or know how to fix it?
    Update:  If I set the "Develop Settings" in Bridge CS5 to "Camera Raw Defaults" for the JPGs/TIFFs that are displaying improperly, the colors and tones go back to normal, but if I "Clear Settings" everything turns to crap again.

    PLEASE  help save my sanity and my reputation!  --I have spent the last five days exhausting every possible solution to this debilitating issue. I have spent countless hours perusing the web for a solution, spent 4 hours yesterday with Adobe customer support and yet, there is no solution to be found. My issue is that the color (in every file format NEF, JPEG, PSD) completely changes color and desaturates in every one of the adobe products: Photoshop CS5, Camera RAW 6.2, Lightroom 3.2. -
    Everything was working fine, and then out of no where my productivity has come to a crashing halt. This is the steps I have taken to this point:
    -Uninstalling/re-installing all of the software
    -Purging anything that can be purged.
    -Changing color profiles
    -Resetting defaults
    -Resetting preferences
    -Installing updated drivers for monitor, video cards
    -rollling back drivers for monitor, video cards
    -monitor recalibration
    **and finally, today...I set the monitor up on another computer, OS windows xp, and to my complete surprise, the issue persists even on another pc with completely different hardware.
    -I am at my wits end with this. I have clients ringing my phone off the hook. This is crazy!
    -I have sent out for another monitor as a last ditch effort to see if something is wrong with the monitor.
    PLEASE, if anyone has a solution please let me know. Apparently, the folks at Adobe are just as perplexed by these issues as we are, as I have found numerous posts on forums throughout the Internet with this same issue---and yet none of the post every found a solution.
    Primary System
    Windows7 64-bit
    Nvidia fx 580 video card
    Dell U2410 Ultra Sharp Monitor
    Abobe CS5 Photoshop -64-bit
    Lightroom 3.2
    Camera Raw 6.2
    Secondary
    Windows XP
    Nvidia GeForce 8400gs
    Same software, just in a 32-bit

  • Lightroom 2 & 3 Beta color, contrast WAY off on display 2

    Lightroom 3 Beta 2  /  Windows 7  64bit  /  Dual calibrated displays
    Display 1 connections are HDMI out to digital in, display 2 is digital out to digital in.
    PROBLEM
    In both the Lightroom 3 Beta 2, and Lightroom 2 v2.6 632038, color, contrast and so on are WAY off on my number 2 monitor. If I drag a Photoshop CS4 window from the left display to the right display I see no difference, looks fine. This is also true with Picasa 3, and iMatch Digital Image Management software and preview images in Picasa photo viewer. The issue seems to be just with Lightroom.
    I don't see any settings for adjustment of the Lightroom right hand screen in either version - Help appreciated, IM

    If you want to, you could zero out all the settings and then save this as a preset and then automatically that preset to all imported images. Not really sure why you would want to do this though. All your images look pretty flat. The default settings do a fair job of approximating what you see on the back of you camera when you made the shot and give you a good place to start. I tried zeroing things out for a while, and then found out I was bringing every image pretty much back to the defaults, and so stopped doing that.

  • So I have been using my iPad for a few months now and I recently noticed that the time display next to the playlist name in the music  app that is supposed to display the total song count and time of a playlist is way off. I have a 25 song playlist that 2

    So I have been using my iPad for a few months now and I recently noticed that the time display next to the playlist name in the music  app that is supposed to display the total song count and time of a playlist is way off. I have a 25 song playlist that is around 2 hours on my computer appears as 2003 minutes on my iPad.  It's a smart playlist limited to 25 songs if that makes any difference. Is this happening to anyone else? Any help would be appreciated!

    Greetings,
    First make an iCal backup, File > Export > Archive.
    Remove the following to the trash and restart your computer:
    Home > Library > Caches
    Home > Library > Calendars > Calendar Cache, Cache, Cache 1, 2, 3, etc. (Do not remove Sync Cache or Theme Cache)
    Home > Library > Preferences > com.apple.ical (There may be more than one of these. Remove them all.)
    __NOTE: Removing these files will remove any shared (CalDAV) calendars you may have access to. You will have to re-add those calendars to iCal > Preferences > Accounts.
    Once the computer is back up and running open iCal and test.
    Hope that helps.

  • Explain plan cardinallity is way off compared to actual rows being returned

    Database version 11.2.0.3
    We have a small but rapidly growing datawarehouse which has OBIEE as its front end reporting tool. Our DBA has set up a automatic stats gathering method in OEM and we can see that it run and gathers stats on stale objects on a regular basis. So we know the statistics are upto date.
    In checking some slow queries I can see that the cardinality being reported in explain plans is way off compared to what is actually being returned.
    For example the actual number of rows returned are 8000 but the cardinality estimate is > 300,000.
    Now as per an Oracle White paper(The Oracle Optimizer Explain the Explain Plan) having "multiple single column predicates on a single table" can affect cardinality estimates and in case of our query that is true. Here is the "WHERE Clause section" of the query
    SQL> select D1.c1  as c1,
      2         D1.c2  as c2,
      3         D1.c3  as c3,
      4         D1.c4  as c4,
      5         D1.c5  as c5,
      6         D1.c6  as c6,
      7         D1.c7  as c7,
      8         D1.c8  as c8,
      9         D1.c9  as c9,
    10         D1.c10 as c10,
    11         D1.c11 as c11,
    12         D1.c12 as c12,
    13         D1.c13 as c13,
    14         D1.c14 as c14,
    15         D1.c15 as c15,
    16         D1.c16 as c16
    17    from (select D1.c4 as c1,
    18                 D1.c5 as c2,
    19                 D1.c3 as c3,
    20                 D1.c1 as c4,
    21                 D1.c6 as c5,
    22                 D1.c7 as c6,
    23                 D1.c2 as c7,
    24                 D1.c8 as c8,
    25                 D1.c9 as c9,
    26                 D1.c10 as c10,
    27                 D1.c9 as c11,
    28                 D1.c11 as c12,
    29                 D1.c2 as c13,
    30                 D1.c2 as c14,
    31                 D1.c12 as c15,
    32                 'XYZ' as c16,
    33                 ROW_NUMBER() OVER(PARTITION BY D1.c2, D1.c3, D1.c4, D1.c5, D1.c6, D1.c7, D1.c8, D1.c9, D1.c10, D1.c11, D1.c12 ORDER BY D1.c2 ASC, D1.c3 ASC, D1.c4 ASC, D1.c5 ASC, D1.c6 ASC, D1.c
    ASC, D1.c8 ASC, D1.c9 ASC, D1.c10 ASC, D1.c11 ASC, D1.c12 ASC) as c17
    34            from (select distinct D1.c1 as c1,
    35                                  D1.c2 as c2,
    36                                  'CHANNEL1' as c3,
    37                                  D1.c3 as c4,
    38                                  D1.c4 as c5,
    39                                  D1.c5 as c6,
    40                                  D1.c6 as c7,
    41                                  D1.c7 as c8,
    42                                  D1.c8 as c9,
    43                                  D1.c9 as c10,
    44                                  D1.c10 as c11,
    45                                  D1.c11 as c12
    46                    from (select sum(T610543.GLOBAL1_EXCHANGE_RATE * case
    47                                       when T610543.X_ZEB_SYNC_EBS_FLG = 'Y' then
    48                                        T610543.X_ZEB_AIA_U_REVN_AMT
    49                                       else
    50                                        0
    51                                     end) as c1,
    52                                 T536086.X_ZEBRA_TERRITORY as c2,
    53                                 T526821.LEVEL9_NAME as c3,
    54                                 T526821.LEVEL1_NAME as c4,
    55                                 T577698.PER_NAME_FSCL_YEAR as c5,
    56                                 T577698.FSCL_QTR as c6,
    57                                 T31796.X_ZEBRA_TERRITORY as c7,
    58                                 T31796.X_OU_NUM as c8,
    59                                 T664055.TERRITORY as c9,
    60                                 T536086.X_OU_NUM as c10,
    61                                 T526821.LEVEL4_NAME as c11
    62                            from W_INT_ORG_D        T613144 /* Dim_ZEB_W_INT_ORG_D_POS_Client_Attr_Direct */,
    63                                 W_ZEBRA_REGION_D   T664055 /* Dim_ZEB_W_ZEBRA_REGION_D_POS_Client_Direct */,
    64                                 W_DAY_D            T577698 /* Dim_ZEB_W_DAY_D_Order_Invoice_Date */,
    65                                 WC_PRODUCT_HIER_DH T526821 /* Dim_WC_PRODUCT_HIER_DH */,
    66                                 W_PRODUCT_D        T32069 /* Dim_W_PRODUCT_D */,
    67                                 W_ORG_D            T31796,
    68                                 W_ORG_D            T536086 /* Dim_ZEB_W_ORG_D_Reseller */,
    69                                 W_ORDERITEM_TMP_F      T610543 /* Fact_ZEB_W_ORDERITEM_F_Direct */
    70                           where (T610543.PR_OWNER_BU_WID = T613144.ROW_WID and
    71                                 T577698.ROW_WID =
    72                                 T610543.X_ZEB_AIA_TRXN_DT_WID and
    73                                 T32069.ROW_WID = T526821.PROD_WID and
    74                                 T32069.ROW_WID = T610543.ROOT_LN_PROD_WID and
    75                                 T536086.ROW_WID = T610543.ACCNT_WID and
    76                                 T31796.DATASOURCE_NUM_ID =
    77                                 T610543.DATASOURCE_NUM_ID and
    78                                 T31796.INTEGRATION_ID = T610543.VIS_PR_BU_ID and
    79                                 T536086.DELETE_FLG = 'N' and
    80                                 T610543.X_ZEB_DELETE_FLG = 'N' and
    81                                 T613144.X_ZEB_REGION_WID = T664055.ROW_WID and
    82                                 T577698.FSCL_DAY_OF_YEAR < 97 and
    83                                 '2006' < T577698.PER_NAME_FSCL_YEAR and
    84                                 T536086.X_OU_NUM <> '11073' and
    85                                 T536086.X_ZEBRA_TERRITORY !=
    86                                 'XX23' and
    87                                 T536086.X_OU_NUM != '56791647728774' and
    88                                 T536086.X_OU_NUM != '245395890' and
    89                                 T536086.X_ZEBRA_TERRITORY !=
    90                                 'STRATEGIC ACCTS 2' and
    91                                 T526821.LEVEL2_NAME != 'Charges' and
    92                                 T526821.LEVEL9_NAME != 'Unspecified' and
    93                                 T536086.X_ZEBRA_TERRITORY !=
    94                                 'XX1' and T536086.X_ZEBRA_TERRITORY !=
    95                                 'XX2' and T536086.X_ZEBRA_TERRITORY !=
    96                                 'XX3' and T536086.X_ZEBRA_TERRITORY !=
    97                                 'XX4' and
    98                                 (T536086.X_ZEBRA_TERRITORY in
    99                                 ( ... In List of 22 values )) and
    125                                 T32069.X_ZEB_EBS_PRODUCT_TYPE is null)
    126                           group by T31796.X_ZEBRA_TERRITORY,
    127                                    T31796.X_OU_NUM,
    128                                    T526821.LEVEL1_NAME,
    129                                    T526821.LEVEL4_NAME,
    130                                    T526821.LEVEL9_NAME,
    131                                    T536086.X_OU_NUM,
    132                                    T536086.X_ZEBRA_TERRITORY,
    133                                    T577698.FSCL_QTR,
    134                                    T577698.PER_NAME_FSCL_YEAR,
    135                                    T664055.TERRITORY) D1) D1) D1
    136   where (D1.c17 = 1)
    137  /
    Elapsed: 00:00:35.19
    Execution Plan
    Plan hash value: 3285002974
    | Id  | Operation                                         | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |    TQ  |IN-OUT| PQ Distrib |
    |   0 | SELECT STATEMENT                                  |                    |  2145M|  2123G|       |   612K  (1)| 03:03:47 |       |       |        |      |            |
    |   1 |  PX COORDINATOR                                   |                    |       |       |       |            |          |       |       |        |      |            |
    |   2 |   PX SEND QC (RANDOM)                             | :TQ10012           |  2145M|  2123G|       |   612K  (1)| 03:03:47 |       |       |  Q1,12 | P->S | QC (RAND)  |
    |*  3 |    VIEW                                           |                    |  2145M|  2123G|       |   612K  (1)| 03:03:47 |       |       |  Q1,12 | PCWP |            |
    |*  4 |     WINDOW NOSORT                                 |                    |  2145M|   421G|       |   612K  (1)| 03:03:47 |       |       |  Q1,12 | PCWP |            |
    |   5 |      SORT GROUP BY                                |                    |  2145M|   421G|   448G|   612K  (1)| 03:03:47 |       |       |  Q1,12 | PCWP |            |
    |   6 |       PX RECEIVE                                  |                    |  2145M|   421G|       |  1740  (11)| 00:00:32 |       |       |  Q1,12 | PCWP |            |
    |   7 |        PX SEND HASH                               | :TQ10011           |  2145M|   421G|       |  1740  (11)| 00:00:32 |       |       |  Q1,11 | P->P | HASH       |
    |*  8 |         HASH JOIN BUFFERED                        |                    |  2145M|   421G|       |  1740  (11)| 00:00:32 |       |       |  Q1,11 | PCWP |            |
    |   9 |          PX RECEIVE                               |                    |   268K|  7864K|       |    93   (2)| 00:00:02 |       |       |  Q1,11 | PCWP |            |
    |  10 |           PX SEND HASH                            | :TQ10009           |   268K|  7864K|       |    93   (2)| 00:00:02 |       |       |  Q1,09 | P->P | HASH       |
    |  11 |            PX BLOCK ITERATOR                      |                    |   268K|  7864K|       |    93   (2)| 00:00:02 |       |       |  Q1,09 | PCWC |            |
    |  12 |             TABLE ACCESS FULL                     | W_ORG_D            |   268K|  7864K|       |    93   (2)| 00:00:02 |       |       |  Q1,09 | PCWP |            |
    |  13 |          PX RECEIVE                               |                    |   345K|    59M|       |  1491   (2)| 00:00:27 |       |       |  Q1,11 | PCWP |            |
    |  14 |           PX SEND HASH                            | :TQ10010           |   345K|    59M|       |  1491   (2)| 00:00:27 |       |       |  Q1,10 | P->P | HASH       |
    |* 15 |            HASH JOIN BUFFERED                     |                    |   345K|    59M|       |  1491   (2)| 00:00:27 |       |       |  Q1,10 | PCWP |            |
    |  16 |             PX RECEIVE                            |                    |  1321 | 30383 |       |     2   (0)| 00:00:01 |       |       |  Q1,10 | PCWP |            |
    |  17 |              PX SEND BROADCAST                    | :TQ10006           |  1321 | 30383 |       |     2   (0)| 00:00:01 |       |       |  Q1,06 | P->P | BROADCAST  |
    |  18 |               PX BLOCK ITERATOR                   |                    |  1321 | 30383 |       |     2   (0)| 00:00:01 |       |       |  Q1,06 | PCWC |            |
    |  19 |                TABLE ACCESS FULL                  | W_ZEBRA_REGION_D   |  1321 | 30383 |       |     2   (0)| 00:00:01 |       |       |  Q1,06 | PCWP |            |
    |* 20 |             HASH JOIN                             |                    |   345K|    52M|       |  1488   (2)| 00:00:27 |       |       |  Q1,10 | PCWP |            |
    |  21 |              JOIN FILTER CREATE                   | :BF0000            |  9740 |   114K|       |     2   (0)| 00:00:01 |       |       |  Q1,10 | PCWP |            |
    |  22 |               PX RECEIVE                          |                    |  9740 |   114K|       |     2   (0)| 00:00:01 |       |       |  Q1,10 | PCWP |            |
    |  23 |                PX SEND HASH                       | :TQ10007           |  9740 |   114K|       |     2   (0)| 00:00:01 |       |       |  Q1,07 | P->P | HASH       |
    |  24 |                 PX BLOCK ITERATOR                 |                    |  9740 |   114K|       |     2   (0)| 00:00:01 |       |       |  Q1,07 | PCWC |            |
    |  25 |                  TABLE ACCESS FULL                | W_INT_ORG_D        |  9740 |   114K|       |     2   (0)| 00:00:01 |       |       |  Q1,07 | PCWP |            |
    |  26 |              PX RECEIVE                           |                    |   344K|    47M|       |  1486   (2)| 00:00:27 |       |       |  Q1,10 | PCWP |            |
    |  27 |               PX SEND HASH                        | :TQ10008           |   344K|    47M|       |  1486   (2)| 00:00:27 |       |       |  Q1,08 | P->P | HASH       |
    |  28 |                JOIN FILTER USE                    | :BF0000            |   344K|    47M|       |  1486   (2)| 00:00:27 |       |       |  Q1,08 | PCWP |            |
    |* 29 |                 HASH JOIN BUFFERED                |                    |   344K|    47M|       |  1486   (2)| 00:00:27 |       |       |  Q1,08 | PCWP |            |
    |  30 |                  JOIN FILTER CREATE               | :BF0001            | 35290 |   964K|       |    93   (2)| 00:00:02 |       |       |  Q1,08 | PCWP |            |
    |  31 |                   PX RECEIVE                      |                    | 35290 |   964K|       |    93   (2)| 00:00:02 |       |       |  Q1,08 | PCWP |            |
    |  32 |                    PX SEND HASH                   | :TQ10004           | 35290 |   964K|       |    93   (2)| 00:00:02 |       |       |  Q1,04 | P->P | HASH       |
    |  33 |                     PX BLOCK ITERATOR             |                    | 35290 |   964K|       |    93   (2)| 00:00:02 |       |       |  Q1,04 | PCWC |            |
    |* 34 |                      TABLE ACCESS FULL            | W_ORG_D            | 35290 |   964K|       |    93   (2)| 00:00:02 |       |       |  Q1,04 | PCWP |            |
    |  35 |                  PX RECEIVE                       |                    |   344K|    38M|       |  1392   (2)| 00:00:26 |       |       |  Q1,08 | PCWP |            |
    |  36 |                   PX SEND HASH                    | :TQ10005           |   344K|    38M|       |  1392   (2)| 00:00:26 |       |       |  Q1,05 | P->P | HASH       |
    |  37 |                    JOIN FILTER USE                | :BF0001            |   344K|    38M|       |  1392   (2)| 00:00:26 |       |       |  Q1,05 | PCWP |            |
    |* 38 |                     HASH JOIN BUFFERED            |                    |   344K|    38M|       |  1392   (2)| 00:00:26 |       |       |  Q1,05 | PCWP |            |
    |  39 |                      PX RECEIVE                   |                    | 93791 |  4671K|       |     7   (0)| 00:00:01 |       |       |  Q1,05 | PCWP |            |
    |  40 |                       PX SEND HASH                | :TQ10001           | 93791 |  4671K|       |     7   (0)| 00:00:01 |       |       |  Q1,01 | P->P | HASH       |
    |  41 |                        PX BLOCK ITERATOR          |                    | 93791 |  4671K|       |     7   (0)| 00:00:01 |       |       |  Q1,01 | PCWC |            |
    |* 42 |                         TABLE ACCESS FULL         | WC_PRODUCT_HIER_DH | 93791 |  4671K|       |     7   (0)| 00:00:01 |       |       |  Q1,01 | PCWP |            |
    |* 43 |                      HASH JOIN                    |                    |   894K|    57M|       |  1384   (2)| 00:00:25 |       |       |  Q1,05 | PCWP |            |
    |  44 |                       JOIN FILTER CREATE          | :BF0002            |   243K|  1904K|       |    48   (3)| 00:00:01 |       |       |  Q1,05 | PCWP |            |
    |  45 |                        PX RECEIVE                 |                    |   243K|  1904K|       |    48   (3)| 00:00:01 |       |       |  Q1,05 | PCWP |            |
    |  46 |                         PX SEND HASH              | :TQ10002           |   243K|  1904K|       |    48   (3)| 00:00:01 |       |       |  Q1,02 | P->P | HASH       |
    |  47 |                          PX BLOCK ITERATOR        |                    |   243K|  1904K|       |    48   (3)| 00:00:01 |       |       |  Q1,02 | PCWC |            |
    |* 48 |                           TABLE ACCESS FULL       | W_PRODUCT_D        |   243K|  1904K|       |    48   (3)| 00:00:01 |       |       |  Q1,02 | PCWP |            |
    |  49 |                       PX RECEIVE                  |                    |   894K|    50M|       |  1336   (2)| 00:00:25 |       |       |  Q1,05 | PCWP |            |
    |  50 |                        PX SEND HASH               | :TQ10003           |   894K|    50M|       |  1336   (2)| 00:00:25 |       |       |  Q1,03 | P->P | HASH       |
    |  51 |                         JOIN FILTER USE           | :BF0002            |   894K|    50M|       |  1336   (2)| 00:00:25 |       |       |  Q1,03 | PCWP |            |
    |* 52 |                          HASH JOIN                |                    |   894K|    50M|       |  1336   (2)| 00:00:25 |       |       |  Q1,03 | PCWP |            |
    |  53 |                           PX RECEIVE              |                    |   292 |  3504 |       |   136   (0)| 00:00:03 |       |       |  Q1,03 | PCWP |            |
    |  54 |                            PX SEND BROADCAST LOCAL| :TQ10000           |   292 |  3504 |       |   136   (0)| 00:00:03 |       |       |  Q1,00 | P->P | BCST LOCAL |
    |  55 |                             PX BLOCK ITERATOR     |                    |   292 |  3504 |       |   136   (0)| 00:00:03 |       |       |  Q1,00 | PCWC |            |
    |* 56 |                              TABLE ACCESS FULL    | W_DAY_D            |   292 |  3504 |       |   136   (0)| 00:00:03 |       |       |  Q1,00 | PCWP |            |
    |  57 |                           PX BLOCK ITERATOR       |                    |  4801K|   215M|       |  1199   (2)| 00:00:22 |     1 |    11 |  Q1,03 | PCWC |            |
    |* 58 |                            TABLE ACCESS FULL      | W_ORDERITEM_TMP_F  |  4801K|   215M|       |  1199   (2)| 00:00:22 |     1 |    44 |  Q1,03 | PCWP |            |
    Note
       - dynamic sampling used for this statement (level=5)
    Statistics
            498  recursive calls
           2046  db block gets
        1193630  consistent gets
          74398  physical reads
              0  redo size
         655170  bytes sent via SQL*Net to client
          11761  bytes received via SQL*Net from client
            541  SQL*Net roundtrips to/from client
             64  sorts (memory)
              0  sorts (disk)
           8090  rows processed
    SQL>So my question is if, cardinality estimates are way off, is that an indicator that the explain plans being generated are sub-optimal?
    Can you provide me with some tips or links to blog post or books on how I approach tuning such queries where cardinalities are not good?
    Edited by: qqq on Apr 7, 2013 2:27 PM

    As already asked in your other thread:
    Please see the FAQ for how to post a tuning request and the information that you need to provide.
    Part of that information is:
    1. DDL for the table and indexes
    2. The query being used
    3. row counts for the table and for the predicates used in the query
    4. info about stats. You did update the table and index stats didn't you?
    5. The 'actual' execution plans.
    An explain plan just shows what Oracle 'thinks' it is going to do. The actual plans show what Oracle actually 'did' do. Just because Oracle expected to save doesn't mean the savings were actually achieved.
    When you post the plans use on the line before and on the line after to preserve formatting.
    Your partial code is virtually unusable because of the missing conditions in the predicates. You need to use '!=' for 'not equals' if that's what those missing conditions are.
    Please edit your post to use code tags, add the missing conditions and provide the other information needed for a tuning request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • How to control more than one instrument via different interfaces at the same time

    Hi, I am new to Labview.  I am working in a project where I have to make a Automated testing tool . So, here is the set up -  I have a Chip on a board to which there are several instruments connected namely Agilent power supply, Agilent pattern gener

  • Inserting Data into Database in Popup - Reflecting in a parent panel

    Hi, I have a popup. The popup has a display table. The table is populated with rows (from a proxy ws operation, data control). Each row has a ADF link on a column that inserts that particular row into a database table, the popup remains popped, if yo

  • Multiple namespaces on a webflow

    Hello ... i am working with weblogic portal 7.0 SP2 my program is about curriculum management (add/edit/remove,..) and have one webflow and one portlet the webflow is about 100Kb and the ebcc said that it cant open it ;) Now i need to divide the webf

  • Using JDBC to send data to MsAccess database

    Hi, I have received a MSAccess database on a file. I have placed the database on a networkdrive, and need to write data to the tables in this database. The networkdrive is mapped like //Data/DB/Databse.mdb How do I connect the jdbc adapter to this da

  • Iphoto slideshow not showing video

    iphoto would not play videos I included in my slideshow.  It use to just stop the slideshow and play the videos then continue on with photos.  Does anyone know why this no longer works?