Calculating points of intersection

Hello,
Do you guys know a method for calculating points of intersection for 2 axis shapes such as a circle.
like if you had
(3^2)+(4^2)=(5^2)
and
(6^2)+(8^2)=(10^2)
and you wanted to calculate the points of intersection.....anyone know how i could do that?
thanks
hwrd

does it not?
import java.*;
import javax.swing.*;
public class Intersect extends Object {
     String xone, yone, xtwo, ytwo;
     String radiusone, radiustwo;
     double xoneint, yoneint, xtwoint, ytwoint;
     double radiusoneint, radiustwoint;
     double d, rsums,a,z,h, newa, newh, newsqrth,newhsqrt;
     double newxoneint, newyoneint,newxtwoint, newytwoint,sqrtpntone,sqrtpnttwo;
     double radiusoneintpow, radiustwointpow, dpow;
     double xthreepositive, xthreenegative,ythreepositive, ythreenegative;
     double newxthreepositive, newxthreenegative,newythreepositive, newythreenegative;
     public static void main (String []args)
          Intersect i = new Intersect();
          i.CircleDefinition();
     public void CircleDefinition()
               xone = JOptionPane.showInputDialog("Please enter x1");
               yone = JOptionPane.showInputDialog("Please enter y1");
               radiusone = JOptionPane.showInputDialog("Please enter r1");
               xtwo = JOptionPane.showInputDialog("Please enter x2");
               ytwo = JOptionPane.showInputDialog("Please enter y2");
               radiustwo = JOptionPane.showInputDialog("Please enter r2");
               xoneint = Double.parseDouble(xone);
               xtwoint = Double.parseDouble(xtwo);
               yoneint = Double.parseDouble(yone);
               ytwoint = Double.parseDouble(ytwo);
               radiusoneint = Double.parseDouble(radiusone);
               radiustwoint = Double.parseDouble(radiustwo);
               DistanceCalculator();
     public void DistanceCalculator()
          newxoneint = Math.pow((xtwoint-xoneint),2);
          newyoneint = Math.pow((ytwoint-yoneint),2);
          d = Math.sqrt((newxoneint+newyoneint));
           *getting the basics working first and then i'll add these functions in later
           *newxoneint =Math.pow(xoneint, 2);
          newxtwoint =Math.pow(xtwoint,2);
          newyoneint = Math.pow(yoneint,2);
          newytwoint = Math.pow(ytwoint,2);
          sqrtpntone =Math.sqrt((newxoneint+newyoneint));
          sqrtpnttwo = Math.sqrt((newxtwoint+newytwoint));
          d= (sqrtpnttwo-sqrtpntone);
          z = radiusoneint+radiustwoint;
          /*if(d>z)
                    JOptionPane.showMessageDialog(null,"i'm sorry but no exist, the circles are separate.");
                    System.exit(0);
          else if (d<z)
               JOptionPane.showMessageDialog(null, "Your cirlces have no intersection because one is contained in the other");
          System.exit(0);
          IntersectCalculations();
     public void IntersectCalculations()
          radiusoneintpow = Math.pow(radiusoneint,2);
          radiustwointpow = Math.pow(radiustwoint,2);
          dpow= Math.pow(d,2);
          a = (((radiusoneintpow)-(radiustwointpow)+(dpow))/(2*d));
          newa = Math.pow(a,2);
          h = Math.sqrt((radiusoneintpow - newa));
          newhsqrt = Math.sqrt(h);
          IntersectFinalCalculation();
     public void IntersectFinalCalculation()
          newxthreepositive = ((xtwoint) + (newhsqrt*(ytwoint-yoneint)/d));
          newxthreenegative = ((xtwoint) - (newhsqrt*(ytwoint-yoneint)/d));
          newythreepositive = ((ytwoint) + (newhsqrt*(xtwoint - xoneint)/d));
          newythreenegative = ((ytwoint) - (newhsqrt*(xtwoint - xoneint)/d));
           *don't floor them make sure they work and then start rounding
           *newxthreepositive = Math.floor(xthreepositive);
          newxthreenegative = Math.floor(xthreenegative);
          newythreepositive = Math.floor(ythreepositive);
          newythreenegative = Math.floor(ythreenegative);*/
          DisplayResults();
     public void DisplayResults()
          JOptionPane.showMessageDialog(null, "your circles intersect at \n\n"+newxthreepositive+","+newythreepositive+"\n\nand\n\n"+newxthreenegative+","+newythreenegative);
          CircleDefinition();
}

Similar Messages

  • Anchor Points and Intersect Guide Lines Disappeared

    Hi! I must have hit some type of command on my keyboard but now my anchor points and intersect guides have disappeared that would normally appear when I roll my mouse over the anchor point or the intersecting paths. I have hit Ctrl + H as well as went to the menu manually and my edges are showing. How do I turn back on this ability to see my anchor points and intersecting lines guide in Illustrator?
    Thanks in advance!!
    Edit: I run on Adobe Illustrator CS5

    Is View > Smart Guides turned on? If not, enable it.
    If Smart Guides are already turned on, check if Align to Grid is enabled in the View menu and turn it off.

  • How to find point of intersection of two geometry?

    Hello,
    Could someone give suggestion about how can i find point of intersection of two geometry?
    I need just point. (x,y,z)
    Thanks

    declare
    -- Local variables here
    i integer;
    l_geometry mdsys.sdo_geometry;
    i integer;
    l_x number;
    l_y number;
    l_cx varchar2(500);
    l_vertexes integer;
    begin
    -- Test statements here
    for wrk in (SELECT SDO_GEOM.SDO_INTERSECTION(SDO_GEOMETRY(2002,
    1,
    NULL,
    SDO_ELEM_INFO_ARRAY(1,
    2,
    1),
    SDO_ORDINATE_ARRAY(1,2,3,2,3,3,0,3,0,5,5,5)),
    SDO_GEOMETRY(2002,
    1,
    NULL,
    SDO_ELEM_INFO_ARRAY(1,
    2,
    1),
    SDO_ORDINATE_ARRAY(2,1,2,10)),
    0.005) as qq
    FROM dual where SDO_RELATE(z.geometry,
    SDO_GEOMETRY(2002,
    1,
    NULL,
    SDO_ELEM_INFO_ARRAY(1, 2, 1),
    SDO_ORDINATE_ARRAY(1,2,3,2,3,3,0,3,0,5,5,5)),
    'mask=anyinteract') = 'TRUE')
    loop
    l_geometry := wrk.qq;
    dbms_output.put_line('count: '||l_geometry.SDO_ORDINATES.count);
    l_vertexes := trunc(l_geometry.SDO_ORDINATES.count / 2);
    for i in 1 .. l_vertexes loop
    l_x := l_geometry.SDO_ORDINATES(2 * i - 1);
    l_y := l_geometry.SDO_ORDINATES(2 * i);
    l_cx := to_char(l_x) || ' ' || to_char(l_y);
    dbms_output.put_line(l_cx);
    if i <> l_vertexes then
    dbms_output.put_line('');
    end if;
    end loop;
    end loop;
    end;
    output
    count: 6
    2 5
    2 3
    2 2
    Thanks for help:)
    Edited by: SVV on 16.11.2009 4:54
    Edited by: SVV on 16.11.2009 9:31

  • Join 3 anchor points for "intersection" effect?

    Hi,
    I'm seriously stuck trying to join 3 open paths with stroke only, into something of an intersection that is dividing 3 pie slots. However I can't join more than 2 of them, as the screenshot below the third one gets left behind, Join command doesn't work   Because I have the opacity down to 70% you can see the ugly overlap in the intersection and I need to join all the 3 points for them to look as they should. Does anyone know if/how this can be done in Illustrator?
    Thanks!

    Laiza,
    You can only have 2 segments from each Anchor Point, so you cannot join 3.
    You may select the three paths and use Object>Path>Outline Stroke, then join the three new closed paths with Pathfinder>Unite.

  • Calculating side of intersecting rectangle in collision

    Hi all,
    I'm trying to determine the side of a rectangle in which a colliding object has intersected with it (i'm working on some bouncing bullet code)
    anyway, this is what I have so far..
    I know, the bounding rectangle of the object being hit (tile)
    (lets say 0,0,64,64 (top, left, width, height))
    I know the projectile is moving 5 pixels per update and has a bounding box of pos.X, pos.Y, 16, 16
    So when the bullet and tile collide, the rectangles intersect and so I know a collision has happened
    but I want to now know which side of the tile object was intersected so i can do
    If top or bottom is the intersecting side then reflect the Y velocity of the bullet (but leave the X projectile)
    if left or right is intersected then reflect X and not Y
    This should then give me this effect
    TTTTTT
    or
    \ .T
    .\ T
    ./ T
    /. T
    but to get that effect I need to know which side of the tile was intersected.
    I also know the position of the bullet at collision and i know the last 12 positions leading up to collision (as i store them in an array for a bouncing action upon collision of other objects such as the player)
    so from that I could work out the trajectory of the bullet through the bounding rectangle of the tile (even though I dont know how but I'm sure mathematics can be my friend on that one :p)
    with all this knowledge, is there a way to achieve what I'm trying to do?
    thanks
    Edited by: harveyball on 05-Jun-2009 14:43

    Hi again,
    so i've found an algorithm to do my intersection and I've implemented a quick php version of the intersection code
    which is
    function intersectLine($line1A, $line1B, $line2A, $line2B)
         $insersectionPoint=array();
         $A1 = $line1B['y']-$line1A['y'];
         $B1 = $line1A['x']-$line1B['x'];
         $C1 = $A1 * $line1A['x'] + $B1 * $line1A['y'];
         $A2 = $line2B['y']-$line2A['y'];
         $B2 = $line2A['x']-$line2B['x'];
         $C2 = $A2 * $line2A['x'] + $B2 * $line2A['y'];
         $det = $A1 * $B2 - $A2 * $B1;
        if($det == 0)
              $insersectionPoint=array("x"=>-1, "y"=>-1);
         else
            $insersectionPoint['x'] = ($B2 * $C1 - $B1 * $C2) / $det;
            $insersectionPoint['y'] = ($A1 * $C2 - $A2 * $C1) / $det;     
         return $insersectionPoint;
         }however, i only want to know if the lines between the given points have actually touched (not the potential of the line if infinity extended)
    My code will return an intersection even if the point hasnt reached that part of the line.
    Can someone help me with the mathematical bit of doing the min and max of the points to work out the actual collision of lines.
    I found this snippet of data from google
    This gives you the location of the intersection of two lines, but what if you have line segments, not lines. In this case, you need to make sure that the point you found is on both of the line segments. If your line segment goes from (x1,y1) to (x2,y2), then to check if (x,y) is on that segment, you just need to check that min(x1,x2) &#8804; x &#8804; max(x1,x2), and do the same thing for y. You must be careful about double precision issues though. If your point is right on the edge of the segment, or if the segment is horizontal or vertical, a simple comparison might be problematic. In these cases, you can either do your comparisons with some tolerance, or else use a fraction class.
    which is obviously what i want to do but I dont understand what this means
    min(x1,x2) &#8804; x &#8804; max(x1,x2)
    what exactly does &#8804; x &#8804; mean?
    Can someone aid in writing the simplified version of the algorithm?
    (java or pseduo is fine :) i just wrote my test function in php because it was quicker)

  • Intersection point of rectangle and line

    So I have a point somewhere on the scene and from that point a line is drawn to the center of the rectangle. Is there a way I can find the point of intersection between the rectangle and the line? Thanks!

    PhiLho wrote:
    abedi_ali wrote:
    For that model I would need to know if the point is on top line of the rectangle, left line ,right, or bottom.Yes. Makes sense.
    However it would be much simpler if there is a way to find that intersection point.The way is the one you just described. Unless you mean a way built-in in JavaFX? The Shape classes have intersects() methods, but they just return a boolean...Yes thats what I figured. I guess my only option is to section it off. Thanks!

  • Line intersection

    Hi
    Is there a method in Java that can calculate the intersection of two lines. I know that there is a Line2D.lineIntersects but this method only returns true or false if the two lines intersect. I need the X, Y point where the 2 lines intersect.

    That point should be very easy to calculate,
    unless
    the lines are parallell or close to.Why would lines being close to parallel make the
    point of intersection more difficult to calculate?
    A valid point, it makes zero difference (ignoring rounding errors that
    may classify non-parallel lines as parallel).Rounding errors (if, for example ints were involved) leading to
    non-parallel being treated as parallel (or vice versa) would be a
    problem.
    With or without rounding error, the equations can yield "signed infinities"
    that have to be dealt with.
    Also there could be a question of precision: if the original line
    segments were the result of measurement then how close they
    are to parallel could make the difference between whether the
    intersection is a reliably calculated value, or a more of a guess.
    The OP shouldn't be put off! It's a reasonable question, and MLRon's
    link provides a simple solution. But it also seems quite reasonable
    to warn that - depending on the context of the original problem -
    being parallel or close to parallel could involve problems.

  • Finding 3 rd point if 2 points and and 2 distances  are given

    hi guys,
    i got a problem while solving a geometry problem. problem description is as follows.
    i have 2 points p1(x1, y1), p2(x2, y2), and i have to find the a point p3 which is d1 distance from p1, and d2 distance form p2.
    here i have to get 2 points for point p3(x3, y3) because i dont know which direction it is.
    how to solve this can anybody help me please.
    regards,
    vemula kiran kumar.
    Message was edited by:
    kirankumarvemula

    hi,
    i tried to solve as u said.
    mean while i tried in some other manner. please can u tellme whether this is correct way or not.
    please see my code.
    * CirclesIntersectionPoints.java
    * Created on March 15, 2007, 4:25 PM
    * Vemula KiranKumar,
    * Associate ID - 1997.
    * GeoSpace Integrated Solutions,
    * Hyderabad.
    package com.org.Demarcation.importcoord;
    * @author Vemula KiranKumar.
    import java.lang.Math;
    class CalculatePoints1 {
    public static void main(String[] args)      {
    CirclesIntersectionPoints newPoints = new CirclesIntersectionPoints(-9, 1, 7, 5, -5, 18);
    System.out.println("In the main program-x1--->"+newPoints.getX1());
    System.out.println("In the main program-y1--->"+newPoints.getY1());
    System.out.println("In the main program-x2--->"+newPoints.getX2());
    System.out.println("In the main program-y2--->"+newPoints.getY2());
    *     This class is used to find the intersection points of two circles
    *     Let Circle1 have a center point A(a,b), and Circle 2 have a center point B(p,q)
    * and radious of circle 1 is r1, radious of circle 2 is r2,
    * intersection points of circle 1 and circle 2 are E(X1, Y1) and (X2, Y2) that have to calculated by this program.
    * procedure: -
    * K = (1/4)squreroot(((r1+r2)^-d^)(d^-(r1-r2)^))
    *     d^ = (x2-x1)^ + (y2-y1)^
    * K is the area of the triangle formed by the centers of the two circles and one of their points of intersection;
    * d is the distance between the circles centers;
    *     r1, r2 are the circles' radii; (x1,y1) and (x2,y2) are the circles' centers
    * The two solutions, then, are
    * x = (1/2)(x2+x1) + (1/2)(x2-x1)(r1^-r2^)/d^ � 2(y2-y1)K/d^
    * y = (1/2)(y2+y1) + (1/2)(y2-y1)(r1^-r2^)/d^ � -2(x2-x1)K/d^
    class CirclesIntersectionPoints {
    /* Default Constructor */
    public CirclesIntersectionPoints(){
    this.a=0;
    this.b=0;
    this.r1=0;
    this.p=0;
    this.q=0;
    this.r2=0;
    this.X1=0;
    this.Y1=0;
    this.X2=0;
    this.Y2=0;
    /* Parameterised constructor*/
    public CirclesIntersectionPoints(double x1, double y1, double d1, double x2, double y2, double d2){
    setA(x1);
    setB(y1);
    setR1(d1);
    setP(x2);
    setQ(y2);
    setR2(d2);
    System.out.println(this.a+", "+this.b+", "+this.r1+", "+this.p+", "+this.q+", "+this.r2 +" --> Real values ");
    try {
    interSectionPoints(); // finding the intersection points.
    } catch (Exception ex) {
    ex.printStackTrace();
    } // finding the intersection points.
    /*----------------Given Point 1(x1, y1) distance d1-------------*/
    public double getA(){
    return this.a;
    private void setA(double x1){
    this.a = x1;
    public double getB(){
    return this.b;
    private void setB(double y1){
    this.b = y1;
    public double getR1(){
    return this.r1;
    private void setR1(double d1){
    this.r1 = d1;
    /*----------------Given Point 2(x2, y2) distance d2-------------*/
    public double getP(){
    return this.p;
    private void setP(double x2){
    this.p = x2;
    public double getQ(){
    return this.q;
    private void setQ(double y2){
    this.q = y2;
    public double getR2(){
    return this.r2;
    private void setR2(double d2){
    this.r2 = d2;
    /*----------------New Point (X1, Y1) -------------*/
    public double getX1(){
    return this.p;
    private void setX1(double newx1){
    this.X1 = newx1;
    public double getY1(){
    return this.Y1;
    private void setY1(double newy1){
    this.Y1 = newy1;
    /*----------------New Point (X2, Y2) -------------*/
    public double getX2(){
    return this.X2;
    private void setX2(double newx2){
    this.X2 = newx2;
    public double getY2(){
    return this.Y2;
    private void setY2(double newy2){
    this.Y2 = newy2;
    /*----------------end of the getter setter ----------------------*/
    * finding the Intersection points.
    * x = (1/2)(x2+x1) + (1/2)(x2-x1)(r1^-r2^)/d^ � 2(y2-y1)K/d^
    * y = (1/2)(y2+y1) + (1/2)(y2-y1)(r1^-r2^)/d^ � -2(x2-x1)K/d^
    public void interSectionPoints() {
    double aa = 0, bb = 0, rr1 = 0, pp = 0, qq = 0, rr2 = 0, sqrdistance = 0, areaoftri = 0;
    double partx1 = 0, partx2 = 0, partx3 = 0;
    double party1 = 0, party2 = 0, party3 = 0;
    double x1 = 0, x2 = 0, y1 = 0, y2 = 0;
    aa = getA();
    bb = getB();
    rr1 = getR1();
    pp = getP();
    qq = getQ();
    rr2 = getR2();
    sqrdistance = sqrdistBetweenCenters(); // getting the distance between the centers of circles.
    areaoftri = areaofTriangle(); // getting the area of triangle.
    * Now Calculate the partx1, partx2, partx3 for XX1, XX2 coordnates,
    * and Calculate the party1, party2, party3 for YY1, YY2 coordnates.
    * _x1 = partx1 + partx2 + partx3
    * _x2 = partx1 + partx2 - partx3
    * _y1 = party1 + party2 + party3        
    * _y2 = party1 + party2 - party3        
    sqrdistance = sqrdistBetweenCenters();
    areaoftri = areaofTriangle();
    * finding the X coordinates.
    partx1 = (pp + aa) / 2;
    partx2 = ((pp - aa) * ( (Math.pow(rr1,2) ) - (Math.pow(rr2,2)) ))/ (2 * sqrdistance);
    partx3 = (2 * (qq - bb) * areaoftri) / sqrdistance;
    _x1 = partx1 + partx2 + partx3;
    _x2 = partx1 + partx2 - partx3;
    * Setting the x coordinates
    setX1(_x1);
    setX2(_x2);
    * finding the Y coordinates.
    party1 = (qq + bb) / 2;
    party2 = ((qq - bb) * ( (Math.pow(rr1,2) ) - (Math.pow(rr2,2)) ))/ (2 * sqrdistance);;
    party3 = -(2 * (pp - aa) * areaoftri) / sqrdistance;
    _y1 = party1 + party2 + party3;
    _y2 = party1 + party2 - party3;
    System.out.println("*******************");
    System.out.println(_y1);
    System.out.println(_y2);
    setY1(_y1);
    setY2(_y2);
    * This method will calculate the K, area of the triangle ABE.
    * K = (1/4)squreroot(((r1+r2)^-d^)(d^-(r1-r2)^))
    * where d is the distance between the two centers.
    * (a, b) --> center of circle 1, with radii r1(given distance d1)
    * (p, q) --> center of circle 2, with radii r2(given distance d2)
    public double areaofTriangle(){
    double areaoftri = 0;
    double part1 = 0;
    double part2 = 0;
    double sqrdistance = 0; //distance between
    double aa,bb,rr1,pp,qq,rr2;
    aa = getA();
    bb = getB();
    rr1 = getR1();
    pp = getP();
    qq = getQ();
    rr2 = getR2();
    System.out.println(aa+", "+bb+", "+rr1+", "+pp+", "+qq+", "+rr2+" -->OK Test Passed.");
    * getting the square of distance between
    * centers of 2 circles.
    sqrdistance= sqrdistBetweenCenters();
    System.out.println("squre distance is --->"+sqrdistance+" -->OK Test Passed.");
    * calculating part1, part 2 and subsitute in formula
    * K = (1/4)squreroot((part1)*(part2))
    part1 = Math.pow((rr1 + rr2),2)- sqrdistance;
    part2 = sqrdistance - Math.pow((rr1 - rr2),2);
    areaoftri = (Math.sqrt(part1*part2))/4;
    System.out.println("Area of Triangle is --->"+areaoftri+" ---> Not OK not Tested Yet");
    return areaoftri;
    * This method calculate the squre of distance between
    * the two points of the circle centers
    public double sqrdistBetweenCenters(){
    double sqrdistance = 0;
    double aa = 0, bb = 0, pp = 0, qq = 0;
    aa = getA();
    bb = getB();
    pp = getP();
    qq = getQ();
    sqrdistance = (Math.pow((pp-aa),2)) + (Math.pow((qq-bb),2));
    return sqrdistance; // OK. Test Passed.(kiran)
    protected String kirankumarVemula;
    /* Given Point 1(x1, y1) with distance d1*/
    private double a;
    private double b;
    private double r1;
    /* Given Point 2 (x2, y2) with distance d2*/
    private double p;
    private double q;
    private double r2;
    /* Calculated Point 1 */
    private double X1;
    private double Y1;
    /* Calculated Point 2 */
    private double X2;
    private double Y2;
    }

  • How to remove/avoid faint line after dividing objects and recoloring intersection

    I created two rings which  should pass through each other similar to the olympic rings.
    I recreate the two rings (both objects, filled no stroke) and position them. I  select them both and click divide using the pathfinders tool.
    I then change the color of one point of intersection to that of the background ring (in this case from pink to black).
    However, as shown in the image below a very faint line is left. This shows up when I create a .pdf file of the ring.
    How can I prevent this faint line from showing? Have searched for the answer but can't find it.

    Probably just an artifact. But you can select that oath and look at the appearance panel and make sure it only has on fill and no stroke.
    Orr you can turn that into alive paint group and use the Live Paint Bucket to fill it with black even though it already is black.
    Or you can redo this by creating outlines of the rings as you did before  selecting both outline rings and clicking on the live paint bucket to turn the art into a live paint group and fill the segment with black.
    If using CS 5 you might want to hide the original path after using the outline stroke command.
    In CS5 when you outline a stroke the original Path is preserved so you either want to use it delete it or turn its visibility off.
    This is the result of the live paint group method

  • Small fine tuning is required in the calculation

    Hi Gurus,
       BI PM module for the report Schedule attainment filtered for one order.
    The result supposed to be Total job scheduled = 1, completed orders = 1 and No of orders completed on Schedule = 0. However, the report shows, Total job scheduled = 7, completed orders = 1 and No of orders completed on Schedule = 0.
       By this what happens is that total jobs scheduled become 930 for Plant = 2200, Planner Group = P01, Order Type = PM03 while Completed orders and Completed orders on Schedule is correct.
        ie Formulae in update routine IF( IS_INITIAL( /BIC/ZIBFDCH ), 1, 0 ).
        Please tell the small fine tuning in the calculation, points will be assigned.
    Regards,
    Kiran A

    Answer Finded

  • PricingCalculator points was not found

    The PricingCalculator points was not found
    There was an error while attempting to add the item to the order.
    error in server.
    14:36:27,125 ERROR [UnknownService]
    atg.commerce.pricing.PricingException: The PricingCalculator points was not foun
    d
    at atg.commerce.pricing.PricingEngineService.getCalculatorForCalculatorT
    ype(PricingEngineService.java:1517)
    at atg.commerce.pricing.OrderPricingEngineImpl.applyPromotions(OrderPric
    ingEngineImpl.java:367)
    at atg.commerce.pricing.OrderPricingEngineImpl.priceOrder(OrderPricingEn
    gineImpl.java:238)
    at atg.commerce.pricing.PricingTools.priceOrderForOrderTotal(PricingTool
    s.java:2805)
    at atg.commerce.pricing.PricingTools.priceOrderSubtotalShipping(PricingT
    ools.java:1796)
    at atg.commerce.pricing.PricingTools.priceOrderSubtotalShipping(PricingT
    ools.java:1737)
    at atg.commerce.pricing.PricingTools.performPricingOperation(PricingTool
    s.java:3064)
    at atg.commerce.pricing.processor.PriceOrderTotal.runProcess(PriceOrderT
    otal.java:138)
    at atg.service.pipeline.PipelineLink.runProcess(PipelineLink.java:233)
    at atg.service.pipeline.PipelineChain.runProcess(PipelineChain.java:343)
    at atg.service.pipeline.PipelineChainContext.runProcess(PipelineChainCon
    text.java:185)
    at atg.service.pipeline.PipelineManager.runProcess(PipelineManager.java:
    453)
    at atg.commerce.pipeline.CommercePipelineManager.runProcess(CommercePipe
    lineManager.java:101)
    at atg.commerce.order.purchase.PurchaseProcessHelper.runProcess(Purchase
    ProcessHelper.java:452)
    at atg.commerce.order.purchase.PurchaseProcessHelper.runRepricingProcess
    (PurchaseProcessHelper.java:358)
    at atg.commerce.order.purchase.PurchaseProcessHelper.runProcessRepriceOr
    der(PurchaseProcessHelper.java:317)
    at atg.commerce.order.purchase.PurchaseProcessHelper.addItemsToOrder(Pur
    chaseProcessHelper.java:890)
    at atg.commerce.order.purchase.CartModifierFormHandler.doAddItemsToOrder
    (CartModifierFormHandler.java:3245)
    at atg.commerce.order.purchase.CartModifierFormHandler.addItemToOrder(Ca
    rtModifierFormHandler.java:2870)
    at atg.projects.store.order.purchase.StoreCartFormHandler.addItemToOrder
    (StoreCartFormHandler.java:1299)
    at atg.projects.store.order.purchase.StoreCartFormHandler.handleAddItemT
    oOrder(StoreCartFormHandler.java:1516)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    Edited by: mmmk on Nov 21, 2012 1:13 AM

    go to your itempricingengine component , either through ACC or dyn/admin
    e.g : http://localhost:7001/dyn/admin/nucleus/atg/commerce/pricing/ItemPricingEngine/
    see your post and pre calculators.
    http://localhost:7001/dyn/admin/nucleus/atg/commerce/pricing/ItemPricingEngine/?propertyName=preCalculators
    http://localhost:7001/dyn/admin/nucleus/atg/commerce/pricing/ItemPricingEngine/?propertyName=postCalculators
    there should be a calculator 'points'...
    there may be some problem due to which your points calculator component in not getting initialized.

  • How can I calculate the area bounded by a large number of intersecting lines displayed on a graph?

    Can I adapt 'particle (or blob) analysis' to a graph, or would I be better off saving my graph as an image and using IMAQ VI's to do particle analysis on the image?

    Almost wish they some sort of a whiteboard feature on this forum. 'Cause this would be easiest to explain with some dynamic pictures.
    Any way, to calculate the area "shared" by two or more functions you subtract the areas. Piecewise: calculate the area of fuction 1 by integrating over range of intersection, calculate the area of fuction 2 by integrating over range of intersection, subtract Area 1 from Area 2 and take the absolute value.
    If more than 2 functions, start with the two functions with the greatest area of overlap, and work towards the smallest.
    This is assuming continuous polynomial functions comprise the intersections and you know the points of intersection. If they are simple linear functions you might be able to do some geometric additions (a
    dd up all the trapizoidal/triangle areas formed by consecutive points of intersection).
    This is the robust works-for-most-cases solution, your particular instance may provide short cuts, but no details were given that might provide clues to those short cuts.
    Good luck.

  • [CS4] Gradient Mesh- uneditable "helper" points

    How do I delete the extra points that appear along a path when using the Gradient Mesh tool?
    If you create an organic shaped object then convert it to a gradient mesh you get a cross pattern with handles at the mesh points. Adding more paths creates more paths. But sometimes these paths have invisible helper points which cause kinks when you try to edit the line. They try to maintain their original shape when the path is moved via the mesh point handles. Anyone who's worked with gradient meshes knows this. By deleting these extra points, the line becomes smooth and workable. It's absolutely essential for example when an additional line is added with the gradient mesh tool and the line takes a shortcut extending it beyond the parameters of the artwork. By deleting the points, the line can be edited and guided back inside the artwork's edges.
    To see these extra points, press the + or - key while the mesh object is selected.
    Previous versions of Illustrator allowed these extra points to be deleted. In CS you merely had to click the - key to change the pen tool to the delete pen tool. Clicking the points was identical to removing anchor points. Simple, easy and absolutely necessary.
    In CS3 the minus-pen tool stopped working until after many hours of searching on the internet I found that by unchecking the "Snap to Point" in the preferences, made it work again.
    I make my living by illustrating. The gradient mesh tool is a huge part of what I do. Without the ability to edit these points the tool is useless.
    I hope they are still editable or I'll have to go back to CS3.
    Thank you.
    BD

    StrongBeaver wrote:
    Using the remove points pen tool does not work for me on gradient mesh points.  The gradient mesh adds vertical or horizontal lines I want to remove either a point or an entire line.
    rcraighead - Already tried your suggestion before asking, didn't work.
    Use the direct select tool to select the anchor point you wish to delete then hit delete. The mesh will be deselected after you hit delete so you have to reselect it and you will see that the anchor point and mesh line associated with it are gone.
    Ray-
    The need to deselect the snap to point option in the preferences persists for CS 5 *** well.
    this is how the direct select to and the delete key work out.
    If you want just one line you have to select the point that intersects with the outer path.

  • Intersection area Circle - Rect

    Hi guys,
    I'm trying to compute the intersecting area of a circle and a rect. I've already searched the web for ages and found some good stuff like this: [Area of intersection between circle and rectangle|http://stackoverflow.com/questions/622287/area-of-intersection-between-circle-and-rectangle], but my problem is, that I don't now how to compute the intersection points of a circle and a rect.
    Is there any way to compute the area easier (e.g. with a java lib)? And how do I compute the intersecting points?
    Thx for any help in advance! Greetings.

    A rectangle and a circle can intersect each other in many ways:
    1) no intersection because one is completely contained by the other or both are completely disjunct;
    2) intersect one edge of the rectangle; there are two intersection points
    3) intersect two adjacent edges of the rectangle; there are four intersection points;
    4) intersect two opposite edges of the rectangle; there are four intersection points;
    5) intersect three edges of the rectangle; there are six intersection points;
    6) intersect all edges of the rectangle; there are eight intersection points.
    Note that some of the points in all cases where both intersect can be identical. You have to figure out each and every situation one by one.
    kind regards,
    Jos

  • Points inside curved shape

    Hi all,
    I need to extract points(pixels) that lie within a curved shape. The curved shape is formed with four bezier curves.
    I think I could use Shape, contains(), and PathIterator().
    Can anybody direct to a link with some code to try or share some snippets to test?
    Thanks!

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class ContainsTest extends JPanel {
        CubicCurve2D.Double[] curves;
        Path2D.Double curvePath;
        Path2D.Double intxnPath;
        Point2D.Double[] intxns;
        boolean showCurves = true;
        boolean showCurvePath = false;
        boolean showIntxnPath = false;
        JCheckBox[] checkBoxes;
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(curves == null) {
                initialize();
            if(showCurves) {
                g2.setPaint(Color.green.darker());
                for(int j = 0; j < curves.length; j++) {
                    g2.draw(curves[j]);
            if(showCurvePath) {
                g2.setPaint(new Color(220,200,230,125));
                g2.fill(curvePath);
            if(showIntxnPath) {
                g2.setPaint(Color.blue);
                g2.draw(intxnPath);
            // Mark intxns in sequence (clockwise).
            Color[] colors = {
                Color.red, Color.green.darker(), Color.blue, Color.orange
            for(int j = 0; j < intxns.length; j++) {
                g2.setColor(colors[j]);
                g2.fill(new Ellipse2D.Double(intxns[j].x-1.5,
                                             intxns[j].y-1.5, 4, 4));
         * Make up some Bezier (CubicCurve2D) curves and Path2Ds to work with.
        private void initialize() {
            double[] coords = {
                0, 100, 140, 160, 250, 300, 375, 290
            CubicCurve2D.Double curve = new CubicCurve2D.Double();
            curve.setCurve(coords, 0);
            Rectangle r = curve.getBounds();
            double[] destCoords = new double[coords.length];
            curves = new CubicCurve2D.Double[4];
            curvePath = new Path2D.Double();
            for(int j = 0; j < curves.length; j++) {
                curves[j] = new CubicCurve2D.Double();
                // Rotate 90 degrees.
                double phi = Math.toRadians(j*90);
                // Move (50) away from the center.
                double x = -50*Math.cos(phi);
                double y = -50*Math.sin(phi);
                AffineTransform at = AffineTransform.getTranslateInstance(x, y);
                at.rotate(phi, r.getCenterX(), r.getCenterY());
                // Transform coords for setting this next curve.
                at.transform(coords, 0, destCoords, 0, coords.length/2);
                curves[j].setCurve(destCoords, 0);
                curvePath.append(curves[j], false);
            createIntxnPath();
         * Create a Path2D of the curve segments that lie between the
         * points of intersection along each curve.
        private void createIntxnPath() {
            // Collect curve intersection points, moving clockwise.
            intxns = new Point2D.Double[curves.length];
            for(int j = 0; j < curves.length; j++) {
                intxns[j] = getIntersection(j, (j+1)%curves.length);
            // Get path segments of each curve that lies between
            // the points of intersection. Move in reverse order
            // of points, viz, anti-clockwise, for congruency of
            // path segments.
            intxnPath = new Path2D.Double();
            for(int j = curves.length-1; j >= 0; j--) {
                int k = (j-1 >= 0) ? j-1 : curves.length-1;
                Path2D.Double subPath = getSubPath(j, intxns[j], intxns[k]);
                intxnPath.append(subPath, true);
         * Find intersection of two curves.
        private Point2D.Double getIntersection(int index, int index2) {
            Point2D.Double p = new Point2D.Double();
            double flatness = 0.001;
            PathIterator pit = curves[index].getPathIterator(null, flatness);
            double[] coords = new double[2];
            double minDist = Double.MAX_VALUE;
            while(!pit.isDone()) {
                int type = pit.currentSegment(coords);
                switch(type) {
                    case PathIterator.SEG_MOVETO:  // fall through
                    case PathIterator.SEG_LINETO:
                        Point2D.Double p2 =
                            getClosestPoint(index2, coords[0], coords[1]);
                        double dist = p2.distance(coords[0], coords[1]);
                        if(dist < minDist) {
                            minDist = dist;
                            p.setLocation(coords[0], coords[1]);
                        break;
                    case PathIterator.SEG_CLOSE:
                        break;
                    default:
                        System.out.println("unexpected type: " + type);
                pit.next();
            return p;
        }

Maybe you are looking for