How to measure distance between two points uisng uiaccelerometer

Hello all,
I am trying to measure distance between two points.So for that i am used uiaccelerometer but its give only rotation changes. I am moving my whole device from one point to another point so for that all x,y & z changes remain same. So how can get the device movement for that?
Thank you..

UIAccelerometer does not give rotation changes, it senses acceleration in each of the 3 axis in g-force units. Moving in a plane from one point to another and stopping will result in a net g-force in that axis of zero. To get distance one has to measure the initial acceleration and then the time before a deceleration is detected. It gets really complicated in real life since the start and stop are not instantaneous.

Similar Messages

  • Find driving distance between two points without using API by use of Lat & Long?

    Using Google geocode API : http://maps.googleapis.com/maps/api/geocode/xml?address=thane&sensor=true
    We performed get distance between search criteria entered by user and all related clubs by lat & long  stored at db.
    2. Two different points such as  
    (origin: Lat1 & Long1) and (destination: Lat2 & Long2)
    We tried for to get distance between these two points,
     (Lat2 & Long2) to (Lat1 & Long1)
    But distance which we get by calculation is simple straight line distance 
    Origin Destination
    (Lat1 & Long1) (Lat2 & Long2)
    3. This is not driving distance as google shows in exact Km
    4. For that Google provide another API (distancematrix API)
    http://maps.googleapis.com/maps/api/distancematrix/xml?origins=Thane&sensor=true&destinations=khopat&mode=driving&language=en%20-%20EN
    5. But there is limit for DistanceMatrix-Service without ClientID and client key
    100 elements per query.
    100 elements per 10 seconds.
    2 500 elements per 24 hour period.
    But as element request exceeds it shows : OVER_QUERY_LIMIT error  
    6. In case of Client ID and Client key
    In Distance Matrix 100 000 elements per 24 hour period,a maximum of 625 elements per query and a maximum of 1 000 elements per 10 seconds.
    As per this one there is option to get purchase these API but basic question is remain same for us if we are requesting single origin and multiple destination then how element calculation done by google?
    But in document google says :
    Elements
    The information about each origin-destination pairing is returned in an element entry. An element contains the following fields:
    Status: See Status Codes for a list of possible status codes.
    Duration: The duration of this route, expressed in seconds (the value field) and as text. The textual representation is localized according to
    the query's language parameter.
    Distance: The total distance of this route, expressed in meters (value) and as text. The textual value uses the unit system specified with the
    unit parameter of the original request, or the origin's region.

    Any information that you see in a google map webpage can be retrieved using the API.  The best way of finding the tags on the webpage is to manually perform the query using an IE webpage.   Then capture the source and save to a file so you
    can use a text editor to look at results.  I often on a webpage use the menu : View -  Source and then copy the source to a text file.
    jdweng

  • Distance between two points with degrees and minutes

    I would like to store several points in the database given degrees and minutes as position. In this example I have point 1 that is E 150, 0/S 30, 0 and points 2 that is E 150, 0/S 30.1. For example if I enter 2 km as distance from position of point 1 I would like the search to return all points witin 2 km.(should return points 2 that is very near)
    If I run the query
    SELECT c.name
    FROM cola_markets_cs c
    WHERE
    SDO_WITHIN_DISTANCE(c.shape,
    SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(150.0, 30.1, NULL), NULL, NULL),
    'distance=10000 unit=KM')
    = 'TRUE';
    I get result both position 1 and 2, but if I decrease to distance=1000 no rows is returned.
    Can you see what I am doing wrong here?
    Can I also combine SDO_WITHIN_DISTANCE with SDO_NN_DISTANCE so I can ask for all points 10 km in distance from the reference point and I can also see the actual distance for each point?
    Thank you
    I have tested with the following code. Do I save the position wrong..?
    CREATE TABLE cola_markets_cs (
    mkt_id NUMBER PRIMARY KEY,
    name VARCHAR2(32),
    shape MDSYS.SDO_GEOMETRY);
    INSERT INTO cola_markets_cs VALUES (
    1,
    'Point 1',
    MDSYS.SDO_GEOMETRY(
    2001,
    8307,
    MDSYS.SDO_POINT_TYPE(150.0, 30.0, NULL),
    NULL,
    NULL
    INSERT INTO cola_markets_cs VALUES (
    2,
    'Point 2',
    MDSYS.SDO_GEOMETRY(
    2001,
    8307,
    MDSYS.SDO_POINT_TYPE(150.0, 30.1, NULL),
    NULL,
    NULL
    -- UPDATE METADATA VIEW --
    -- Update the USER_SDO_GEOM_METADATA view. This is required
    -- before the Spatial index can be created. Do this only once for each
    -- layer (i.e., table-column combination; here: cola_markets_cs and shape).
    INSERT INTO USER_SDO_GEOM_METADATA
    VALUES (
    'cola_markets_cs',
    'shape',
    MDSYS.SDO_DIM_ARRAY(
    MDSYS.SDO_DIM_ELEMENT('Longitude', -180, 180, 10), -- 10 meters tolerance
    MDSYS.SDO_DIM_ELEMENT('Latitude', -90, 90, 10) -- 10 meters tolerance
    8307 -- SRID for 'Longitude / Latitude (WGS 84)' coordinate system
    -- CREATE THE SPATIAL INDEX --
    -- Must be R-tree; quadtree not supported for geodetic data.
    CREATE INDEX cola_spatial_idx_cs
    ON cola_markets_cs(shape)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    --This search only return if distance is 10 000 km...
    SELECT c.name
    FROM cola_markets_cs c
    WHERE
    SDO_WITHIN_DISTANCE(c.shape,
    SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(150.0, 30.1, NULL), NULL, NULL),
    'distance=10000 unit=KM')
    = 'TRUE';
    --According to this search the distance to point 1 is 3331198,72256398,
    --this  should be zero..
    SELECT
    c.mkt_id, c.name, SDO_NN_DISTANCE(1) dist
    FROM cola_markets_cs c
    WHERE SDO_NN(c.shape,
    sdo_geometry(2001, 8307,sdo_point_type(150.0, 30.1, NULL), NULL, NULL),
    'sdo_num_res=2', 1) = 'TRUE' ORDER BY dist

    Hi,
    What version of Oracle are you using? I got this using your example:
    SELECT
    c.mkt_id, c.name, SDO_NN_DISTANCE(1) dist
    FROM cola_markets_cs c
    WHERE SDO_NN(c.shape,
    sdo_geometry(2001, 8307,sdo_point_type(150.0, 30.1, NULL), NULL, NULL), 'sdo_num_res=2', 1) = 'TRUE'
    ORDER BY dist ;
    MKT_ID NAME DIST
    2 Point 2 0
    1 Point 1 11085.3285
    This is 10.1.0.4
    Also:
    Can I also combine SDO_WITHIN_DISTANCE with SDO_NN_DISTANCE so I can ask for all points 10 km in distance from the reference point and I can also see the actual distance for each point?
    No, but you can add a distance calculation:
    SELECT
    c.mkt_id, c.name, SDO_GEOM.SDO_DISTANCE(c.shape,sdo_geometry(2001, 8307,sdo_point_type(150.0, 30.1, NULL), NULL, NULL),1) dist
    FROM cola_markets_cs c
    WHERE SDO_WITHIN_DISTANCE(c.shape,
    sdo_geometry(2001, 8307,sdo_point_type(150.0, 30.1, NULL), NULL, NULL), 'distance=10 unit=km') = 'TRUE'
    ORDER BY dist ;

  • Getting the length between two points

    Hi All,
    I am trying to get the distance between two points and came across the SDO_LENGTH function in the manual - however there is no example on how to use it.
    I was expecting the following statement to return me the value 9 but instead I am getting errors along the lines of SDO_GEOM.SDO_LENGTH must be declared etc.
    =============================================
    SDO_GEOM.SD0_LENGTH(
    MDSYS.SDO_GEOMETRY(2
    ,NULL
    ,NULL
    ,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1)
    ,MDSYS.SDO_ORDINATE_ARRAY(1,1,10,10))
    ,MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.0001)
    ,MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.0001))
    ============================================
    what am I missing
    any help appreciated
    Brent Glover

    I think I have found my answer
    ============================================
    DECLARE
    v_length NUMBER;
    BEGIN
    v_length := SDO_GEOM.SDO_LENGTH(
    MDSYS.SDO_GEOMETRY(2
    ,NULL
    ,NULL
    ,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1)
    ,MDSYS.SDO_ORDINATE_ARRAY(1,1,10,10))
    ,MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.0001)
    ,MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.0001))
    DBMS_OUTPUT.put_line(v_length);
    END;
    =============================================

  • How to draw a line(shortest distance)  between two ellipse using SWING

    how to draw a line(should be shortest distance) between two ellipse using SWING
    any help will be appreciated
    regards

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class ELine extends JPanel {
        Ellipse2D.Double red = new Ellipse2D.Double(150,110,75,165);
        Ellipse2D.Double blue = new Ellipse2D.Double(150,50,100,50);
        Line2D.Double line = new Line2D.Double();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setPaint(Color.green.darker());
            g2.draw(line);
            g2.setPaint(Color.blue);
            g2.draw(blue);
            g2.setPaint(Color.red);
            g2.draw(red);
        private void connect() {
            double flatness = 0.01;
            PathIterator pit = blue.getPathIterator(null, flatness);
            double[] coords = new double[2];
            double x1 = 0, y1 = 0, x2 = 0, y2 = 0;
            double min = Double.MAX_VALUE;
            while(!pit.isDone()) {
                int type = pit.currentSegment(coords);
                switch(type) {
                    case PathIterator.SEG_MOVETO:
                    case PathIterator.SEG_LINETO:
                        Point2D.Double p = getClosestPoint(coords[0], coords[1]);
                        double dist = p.distance(coords[0], coords[1]);
                        if(dist < min) {
                            min = dist;
                            x1 = coords[0];
                            y1 = coords[1];
                            x2 = p.x;
                            y2 = p.y;
                        break;
                    case PathIterator.SEG_CLOSE:
                        break;
                    default:
                        System.out.println("blue type: " + type);
                pit.next();
            line.setLine(x1, y1, x2, y2);
        private Point2D.Double getClosestPoint(double x, double y) {
            double flatness = 0.01;
            PathIterator pit = red.getPathIterator(null, flatness);
            double[] coords = new double[2];
            Point2D.Double p = new Point2D.Double();
            double min = Double.MAX_VALUE;
            while(!pit.isDone()) {
                int type = pit.currentSegment(coords);
                switch(type) {
                    case PathIterator.SEG_MOVETO:
                    case PathIterator.SEG_LINETO:
                        double dist = Point2D.distance(x, y, coords[0], coords[1]);
                        if(dist < min) {
                            min = dist;
                            p.setLocation(coords[0], coords[1]);
                        break;
                    case PathIterator.SEG_CLOSE:
                        break;
                    default:
                        System.out.println("red type: " + type);
                pit.next();
            return p;
        public static void main(String[] args) {
            final ELine test = new ELine();
            test.addMouseListener(test.mia);
            test.addMouseMotionListener(test.mia);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.add(test);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    Graphics g = test.getGraphics();
                    g.drawString("drag me", 175, 80);
                    g.dispose();
        private MouseInputAdapter mia = new MouseInputAdapter() {
            Point2D.Double offset = new Point2D.Double();
            boolean dragging = false;
            public void mousePressed(MouseEvent e) {
                Point p = e.getPoint();
                if(blue.contains(p)) {
                    offset.x = p.x - blue.x;
                    offset.y = p.y - blue.y;
                    dragging = true;
            public void mouseReleased(MouseEvent e) {
                dragging = false;
            public void mouseDragged(MouseEvent e) {
                if(dragging) {
                    double x = e.getX() - offset.x;
                    double y = e.getY() - offset.y;
                    blue.setFrame(x, y, blue.width, blue.height);
                    connect();
                    repaint();
    }

  • Distance between two GPS points

    Is there an inbuilt function in PL/SQL for calulating the distance between two GPS (lat/long) points?
    I'm using Oracle 9i. There's a thing called SDO_GEOM available, but I'm not sure if this is what its used for or if it's the best option.

    If the earth is a complete globe and its circumference is 40000km,
    I make the function as follows.
    create ore replace
    function distance
    (a_lat number,a_lon number,b_lat number, b_lon number)
    return number is
    circum number := 40000; -- kilometers
    pai number := acos(-1);
    a_nx number;
    a_ny number;
    a_nz number;
    b_nx number;
    b_ny number;
    b_nz number;
    inner_product number;
    begin
    if (a_lat=b_lat) and (a_lon=b_lon) then
    return 0;
    else
    a_nx := cos(a_lat*pai/180) * cos(a_lon*pai/180);
    a_ny := cos(a_lat*pai/180) * sin(a_lon*pai/180);
    a_nz := sin(a_lat*pai/180);
    b_nx := cos(b_lat*pai/180) * co s(b_lon*pai/180);
    b_ny := cos(b_lat*pai/180) * sin(b_lon*pai/180);
    b_nz := sin(b_lat*pai/180);
    inner_product := a_nx*b_nx + a_ny*b_ny + a_nz*b_nz;
    if inner_product > 1 then
    return 0;
    else
    return (circum*acos(inner_product))/(2*pai);
    end if;
    end if;
    end;
    I rewrite it by using the factorization and the triangle function's sum and difference formulas:
    cos(x-y) = cos(x)cos(y)+sin(x)sin(y)
    As result, this function is same to the 1st method of Billy Verreynne.
    create or replace
    function distance
    (a_lat number,a_lon number,b_lat number, b_lon number)
    return number is
    circum number := 40000; -- kilometers
    pai number := acos(-1);
    dz number;
    dx2y2 number;
    inner_product number;
    begin
    if (a_lat=b_lat) and (a_lon=b_lon) then
    return 0;
    else
    dz := sin(a_lat*pai/180)*sin(b_lat*pai/180);
    dx2y2 := cos(a_lat*pai/180)*cos(b_lat*pai/180)*cos((a_lon-b_lon)*pai/180);
    inner_product := dz*dz + dx2y2;
    if inner_product > 1 then
    return 0;
    else
    return (circum*acos(inner_product))/(2*pai);
    end if;
    end if;
    end;
    Message was edited by:
    ushitaki

  • How do you find the average value of all the data between two points on a single channel

    I am tring to calculate the average value of all the data points on a single plot between two seperate points
    I have attahced an illustration.
    Tim
    Solved!
    Go to Solution.
    Attachments:
    plot.jpg ‏173 KB

    Hey smoothdurban,
    I've seen Brad's code, and trust me, it's worth the effort to let him help you get it up and running - it's definitely the most ideal way to solve this problem.  However, as Brad said, there are multiple ways to tackle this - both interactive and programmatic - so in the meantime, I'll take a second to detail one of the interactive and sure-fire ways to find the average of data between two points on a single channel.
    We'll use"Flags."  Set up your VIEW graph exactly as you did on your original screenshot, using Band Cursors to approximate the beginning and ending X-values representing the range you want to examine.  Next:
    1. Click the "Set Flags" button () that is a part of your 2D Axis System.  Note that you can hold down the Shift button if you ever decide you want to do this on more than a single curve at one time.
    2. Select the "Flags: Copy Data Points" button that enables after Flags are set.
    3. This creates new channel(s) in the default (bold) group in the Data Portal that contains only the Flagged data.
    4. Select DIAdem ANALYSIS.
    5. Select Statistics » Descriptive Statistics.
    6. In the Channels input, select the newly created channel containing your Flagged Y-Data.
    7. Ensure that the Arithmetic Mean parameter is set.  You can preview the data and the result in the dialog before pressing OK to execute the calculation. 
    You may have noticed that in the Descriptive Statistics calculation, one of the parameters that you can set is the range of channel rows to operate on - so, if you know the row numbers of your beginning and ending X-values, you could just simply run the Descriptive Statistics calculation and use this parameter to operate on a row subset of your original channel instead of the entire channel.
    Derrick S.
    Product Manager
    NI DIAdem
    National Instruments

  • Distance between two objects

    Hi folks,
    Who knows how I can discover the distance between two selected objects without using neither guides nor grids?
    Thanks.

    How do imagine this would working without using guides or grids? The way I normally do it is:
    1. Drag out a guide to point A
    2. Drag out a guide to point B
    3. Hold shift and put the mouse cursoe between the two -- it shows you the distance
    You could also use the measuring tool (click and hold the rectangle tool in the tool pallette.)
    Or even just draw a rectangle and look at the width in the property panel. That's a fast and easy method I use sometimes.
    Aaron Beall
    http://fireworks.abeall.com

  • Trendline between two points

    hi
    i have a code like this
    trendline.jsp
    <%@page import="ChartDirector.*" %>
    <%
    // The data for the line chart
    double[] data = {50, 55, 47, 34, 42, 49, 63, 62, 73, 59, 56, 50, 64, 60, 67, 67, 58,
        59, 73, 77, 84, 82, 80, 91};
    // The labels for the line chart
    String[] labels = {"Jan 2000", "Feb 2000", "Mar 2000", "Apr 2000", "May 2000",
        "Jun 2000", "Jul 2000", "Aug 2000", "Sep 2000", "Oct 2000", "Nov 2000",
        "Dec 2000", "Jan 2001", "Feb 2001", "Mar 2001", "Apr 2001", "May 2001",
        "Jun 2001", "Jul 2001", "Aug 2001", "Sep 2001", "Oct 2001", "Nov 2001",
        "Dec 2001"};
    // Create a XYChart object of size 500 x 320 pixels, with a pale purpule (0xffccff)
    // background, a black border, and 1 pixel 3D border effect.
    XYChart c = new XYChart(500, 320, 0xffccff, 0x000000, 1);
    // Set the plotarea at (55, 45) and of size 420 x 210 pixels, with white background.
    // Turn on both horizontal and vertical grid lines with light grey color (0xc0c0c0)
    c.setPlotArea(55, 45, 420, 210, 0xffffff, -1, -1, 0xc0c0c0, -1);
    // Add a legend box at (55, 25) (top of the chart) with horizontal layout. Use 8 pts
    // Arial font. Set the background and border color to Transparent.
    c.addLegend(55, 22, false, "", 8).setBackground(Chart.Transparent);
    // Add a title box to the chart using 13 pts Times Bold Italic font. The text is
    // white (0xffffff) on a purple (0x800080) background, with a 1 pixel 3D border.
    c.addTitle("Long Term Server Load", "Times New Roman Bold Italic", 13, 0xffffff
        ).setBackground(0x800080, -1, 1);
    // Add a title to the y axis
    c.yAxis().setTitle("MBytes");
    // Set the labels on the x axis. Rotate the font by 90 degrees.
    c.xAxis().setLabels(labels).setFontAngle(90);
    // Add a line layer to the chart
    LineLayer lineLayer = c.addLineLayer();
    // Add the data to the line layer using light brown color (0xcc9966) with a 7 pixel
    // square symbol
    lineLayer.addDataSet(data, 0xcc9966, "Server Utilization").setDataSymbol(
        Chart.SquareSymbol, 7);
    // Set the line width to 2 pixels
    lineLayer.setLineWidth(2);
    // tool tip for the line layer
    lineLayer.setHTMLImageMap("", "", "title='{xLabel}: {value} MBytes'");
    // Add a trend line layer using the same data with a dark green (0x008000) color. Set
    // the line width to 2 pixels
    TrendLayer trendLayer = c.addTrendLayer(data, 0x008000, "Trend Line");
    trendLayer.setLineWidth(2);
    // tool tip for the trend layer
    trendLayer.setHTMLImageMap("", "", "title='Change rate: {slope|2} MBytes/per month'");
    // output the chart
    String chart1URL = c.makeSession(request, "chart1");
    // include tool tip for the chart
    String imageMap1 = c.getHTMLImageMap("");
    %>
    <html>
    <body topmargin="5" leftmargin="5" rightmargin="0">
    <div style="font-size:18pt; font-family:verdana; font-weight:bold">
        Trend Line Chart
    </div>
    <img src='<%=response.encodeURL("getchart.jsp?"+chart1URL)%>'
        usemap="#map1" border="0">
    <map name="map1"><%=imageMap1%></map>
    </body>
    </html>getchart.jsp
    <%@page import="ChartDirector.*" %><%
    try
         out.clear();
         GetSessionImage.getImage(request, response);
         if (Math.max(1, 2) == 2) return;
    catch (IllegalStateException e)
         response.sendRedirect(response.encodeRedirectURL(
              "getchart.chart?" + request.getQueryString()));
         return;
    %>i have to draw a trendline chart...
    i searched for examples...
    i come across this. above example..
    actually my querry is i ve to draw the trendline between two points.
    in between "data" ( 63 to 70) only...
    is there any way to do this
    please help me
    thank you in advance.

    hi
    i tried this..
    <%@page import="ChartDirector.*" %>
    <%
    // The data for the line chart
    double[] dataX0 = {6};
    double[] dataY0 = {63};
    String[] labels2 = {"Jul 2000", "Aug 2000", "Sep 2000", "Oct 2000", "Nov 2000",
        "Dec 2000"};
    // The lengths (radii) and directions (angles) of the vectors
    double[] dataR = {3};
    double[] dataA = {60};
    // The labels for the line chart
    String[] labels = {"Jan 2000", "Feb 2000", "Mar 2000", "Apr 2000", "May 2000",
        "Jun 2000", "Jul 2000", "Aug 2000", "Sep 2000", "Oct 2000", "Nov 2000",
        "Dec 2000", "Jan 2001", "Feb 2001", "Mar 2001", "Apr 2001", "May 2001",
        "Jun 2001", "Jul 2001", "Aug 2001", "Sep 2001", "Oct 2001", "Nov 2001",
        "Dec 2001"};
    // Create a XYChart object of size 500 x 320 pixels, with a pale purpule (0xffccff)
    // background, a black border, and 1 pixel 3D border effect.
    XYChart c = new XYChart(500, 320, 0xffccff, 0x000000, 1);
    // Set the plotarea at (55, 45) and of size 420 x 210 pixels, with white background.
    // Turn on both horizontal and vertical grid lines with light grey color (0xc0c0c0)
    c.setPlotArea(55, 45, 420, 210, 0xffffff, -1, -1, 0xc0c0c0, -1);
    // Add a legend box at (55, 25) (top of the chart) with horizontal layout. Use 8 pts
    // Arial font. Set the background and border color to Transparent.
    c.addLegend(55, 22, false, "", 8).setBackground(Chart.Transparent);
    // Add a title box to the chart using 13 pts Times Bold Italic font. The text is
    // white (0xffffff) on a purple (0x800080) background, with a 1 pixel 3D border.
    c.addTitle("Long Term Server Load", "Times New Roman Bold Italic", 13, 0xffffff
        ).setBackground(0x800080, -1, 1);
    // Add a title to the y axis
    c.yAxis().setTitle("MBytes");
    // Set the labels on the x axis. Rotate the font by 90 degrees.
    c.xAxis().setLabels(labels).setFontAngle(90);
    c.addVectorLayer(dataX0, dataY0, dataR, dataA,1, 0x0000cc
        ).setArrowHead(11);
    /*LineLayer layer1 = c.addLineLayer();
    //LineLayer layer1 = c.addLineLayer(dataY0, 0xff3333, "Compound AAA");
    layer1.addDataSet(dataY0, 0xff3333, "Close Loop Line").setDataSymbol( Chart.LeftTriangleSymbol, 10);
    layer1.setXData(dataX0);
    layer1.setLineWidth(2);*/
    // Add a line layer to the chart
    LineLayer lineLayer = c.addLineLayer2();
    // Add the data to the line layer using light brown color (0xcc9966) with a 7 pixel
    // square symbol
    lineLayer.addDataSet(data, 0xcc9966, "Server Utilization").setDataSymbol(
        Chart.SquareSymbol, 7);
    lineLayer.setLineWidth(2);
    // output the chart
    String chart1URL = c.makeSession(request, "chart1");
    // include tool tip for the chart
    //String imageMap1 = c.getHTMLImageMap("");
    %>
    <html>
    <body topmargin="5" leftmargin="5" rightmargin="0">
    <div style="font-size:18pt; font-family:verdana; font-weight:bold">
        Trend Line Chart
    </div>
    <img src='<%=response.encodeURL("getchart.jsp?"+chart1URL)%>'
        usemap="#map1" border="0">
    </body>
    </html>how can i set the angle of direction for the arrow..
    suppose
    i wanna draw an arrow b/w these points
    y=50 to y=37
    how can give the length and direction here
    c.addVectorLayer(dataX0, dataY0, dataR, dataA,1, 0x0000cc
        ).setArrowHead(11);i mean in daraR and dataA...
    please help me
    thank you in advance

  • Customizing distance between data Points on x-Axis

    Hi,
    I want to draw a LineChart.
    I have these Timestamps [84, 1000, 34000, 34699, 439999] who
    are represanting the x-Value of DataPoints along the X-Axis.
    Unfortunately the distance between 2 datapoints along the
    x-Axis is always the same, that means that between the points with
    x-values 84 and 1000 is the same distance along the axis as between
    the points with x-values 34699 and 439999.
    But the distance between points with x-values of 34699 and
    439999 should be much greater than between 84 and 1000.
    How can I customize the distance between data Points on a
    LineChart to solve my Problem?
    I really dont know right now!
    Greeting,
    Z.

    "zidaninho" <[email protected]> wrote in
    message
    news:gls479$nkt$[email protected]..
    > Hi,
    >
    > I want to draw a LineChart.
    > I have these Timestamps [84, 1000, 34000, 34699, 439999]
    who are
    > represanting
    > the x-Value of DataPoints along the X-Axis.
    >
    > Unfortunately the distance between 2 datapoints along
    the x-Axis is always
    > the
    > same, that means that between the points with x-values
    84 and 1000 is the
    > same
    > distance along the axis as between the points with
    x-values 34699 and
    > 439999.
    > But the distance between points with x-values of 34699
    and 439999 should
    > be
    > much greater than between 84 and 1000.
    >
    > How can I customize the distance between data Points on
    a LineChart to
    > solve
    > my Problem?
    >
    > I really dont know right now!
    What happens if you convert the time stamps to Dates and use
    a DateAxis?

  • Bearing between two points

    This may be an obvious question to more experienced users, but I can't seem to find anything on it in the documentation.
    Is there any way to find the bearing of a line segment, that is, the angle between due north and the line between two points? It seems so simple, and Spatial provides a function to find a point at a specified distance and heading from another, so it seems like existing functionality.
    Thanks in advance - J

    Upgrading to 11g is one option.
    The other option is to write this function in PL/SQL yourself if you don't need a very accurate solution.
    This web page here gives a simple algorithm to find the bearing for two points.
    http://www.movable-type.co.uk/scripts/latlong.html

  • Finding Distance between two zipcodes with longtitude and latitude

    Want to find distance between two zipcodes that have their latitude and longitude stored in a table.
    The table is as follows
    CREATE TABLE distance (zipcode VARCHAR2, LNG NUMBER, LAT NUMBER)
    I couldn't come up with a calculation or understand the mathematical calculation on line.. Can you help me with some stored procedure that will do..?
    Thanks

    There is no logical complexity in your query besides knowing the basics of
    http://en.wikipedia.org/wiki/Spherical_coordinates
    Also, the table name "Distance" cannot be more confusing; what you have is essentially "PointsOnSphere".
    select R*sqrt(
    (sin(pi-p1.lng)*cos(p1.lat)-sin(pi-p2.lng)*cos(p2.lat))* (sin(pi-p1.lng)*cos(p1.lat)-sin(pi-p2.lng)*cos(p2.lat))
    +
    (sin(pi-p1.lng)*sin(p1.lat)-sin(pi-p2.lng)*sin(p2.lat))*
    (sin(pi-p1.lng)*sin(p1.lat)-sin(pi-p2.lng)*sin(p2.lat))
    +
    (cos(pi-p1.lng)-cos(pi-p2.lng))*(cos(pi-p1.lng)-cos(pi-p2.lng))
    from distance p1, distance p2
    where R is the radius of Earth, and pi=3. Don't forget to convert angular degrees into radiants before you plug in them into the query above
    Correction: This was euclidean distance sqrt((x1-x2)^2+(y1-y2)^2+(z1-z2)^2) between the points (x1,y1,z1) and (x2,y2,z2). Spherical distance is
    sqrt(
    (R*(colatitude1-colatitude2))^2+
    (R*sin(colatitude1-colatitude2)*(longtitude1-longtitude2))^2
    Message was edited by:
    Vadim Tropashko

  • Distance between two PCIe x 16 slot of P55 GD85

    Hello,
    Does anyone have an idea what is the clear distance between two PCIe x 16 slot of P55 GD85? planning to get one if my 2 x GTX 285 with modified cooling fan will fit in. each VGA with modified fan is around 55mm in height.
    thank you,   

    Exactly, there was no "rude" intention or the will to provoke you behind my previous answer.  In fact, I spent 15 minutes to find a ruler in order to measure the port distance on three different ATX Board to make sure I am not telling you anything wrong.  I would not have bothered to do that if I had been planning to write a rude reply. 
    [On the flip side: Personally, I find it kind of rude that you are accusing me of 'rudeness'.  However, I suggest we better drop the whole 'who is really being rude here' discussion.]
    Quote
    The distance between the center lines of two neighbouring slots is always ~ 2.05cm.  There are two slots between the PCI-E-x16 slots of the P55-DG85.  Simply do the math!
    Quote
    I am not a mathematician
    The distance between the center lines of the two PCI-E-x16-slots of the P55-GD85 is ~6.15cm (there are two more slots in between --> 2.05cm x 3).
    This means that this ...
    Quote
    each VGA with modified fan is around 55mm in height.
    ... should actually fit.

  • Distance between two pixel in screen

    Hi all ,
    How can I get the distance between two pixel of the screen .
    Thanks and Regards
    Anshuman Srivastava

    You're welcome. Do spend more time with the API, there are a wealth of methods available in classes like Toolkit, SwingUtilities, Utilities and Robot that help solve many rather obscure problems.
    db

  • How to calculate days between two DATES

    How to calculate days between two DATES ?
    which is the functional module for that ?
    help me

    Hi,
    use function module : it works,
    HR_HK_DIFF_BT_2_DATES
    give output format = 03 and get the value in days.
    code is as below :
    data : DATE1 type P0001-BEGDA,
    DATE2 type P0001-BEGDA,
    YEARS type P0347-SCRYY,
    MONTHS type P0347-SCRMM,
    DAYS type P0347-SCRDD.
    date1 = '20070331'.
    date2 = '20070101'.
    CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
    EXPORTING
    DATE1 = date1
    DATE2 = date2
    OUTPUT_FORMAT = '03'
    IMPORTING
    YEARS = years
    MONTHS = months
    DAYS = days
    EXCEPTIONS
    INVALID_DATES_SPECIFIED = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write : days.
    Reward points, if helpful,
    Regards,
    Sandeep Kaushik

Maybe you are looking for