Distance to a line

Hi all,
Can't figure out this. I have 3 points A(305,108),B(311,119) and C(348,172), to find out the distance from B to AC, i use a method found here http://www.worsleyschool.net/science/files/linepoint/method5.html
I then got the distance equals to 131. When I draw AC and B, it appears B is almost on the line (distance <= 1). Am i doing wrong? what does 131 mean?
TIA
-s

Never mind. I did wrong.

Similar Messages

  • Shortest distance between two line segments

    Hi.
    I am looking for the code of the "Shortest distance between two line segments". I would appreciate if anyone has and willing to share.
    I can find some in the net but its in VB and i am not familiar with it.
    THanks a lot.
    regards,

    There are a couple of things that are not clear:
    What determines the rotation speed and lenght of each stick at any given time?
    What is the program allowed to do to prevent collision (change speed/direction, change radius, stop everything)
    Since you want to prevent collision, you need a predictive algorithm. Once they overlap, the collision has already happened. Too late!
    What information does your algorithm get (e.g. r1, r2, theta1, theta2, delta-thetat1, delta-theta2, etc.), i.e. does the program only get static information and need  to construct the trajectory from sequential history data or does it get dynamic information about speed and direction?
    The trivial answer would be to just keep r1+r2 < distance(P1,P2). This will prevent all "potential" collisions.
    LabVIEW Champion . Do more with less code and in less time .

  • Distance between next line

    Dear experts,
    In sapscript if use the following code,i find that something like this is happening
    I have given code for the window i created myself ZWIN
    /E: HEADING
    AS:   Mr Bob Williams
    AS:  12,Vincent Street
    AS   :London.
    But i find text comes on paper like this on printing.
    Mr Bob Williams
    12,Vincent Street
    London
    There is a lot of distance between next line.Which attribute i need to control ?

    Hi,
    you can create customized paragraph format based on your requirement. But its better to understand each and every function in the styles so that you can understand the behaviour.
    Thanks
    Arul

  • Line string validation and ORA-13349 on polygons

    Hi all,
    We are having the following problem:
    Our application accepts linestrings and connects them to create polygons. Each individual line validates TRUE but some polygons validate with ORA-13349. The problem is caused by lines that we call Lightning bolts. These are lines that cut back very sharp on themselves so that one or more points are within tolerance distance of a line segment.
    An example:
    mdsys.sdo_geometry(2002
    ,null
    ,null
    ,mdsys.sdo_elem_info_array(1, 2, 1)
    ,MDSYS.SDO_ORDINATE_ARRAY(258699.59,472878.73
    ,258688.58,472879.66
    ,258688.589,472879.659));
    Oracle spatial seems to be very tolerant in validating these lines but once they are used in a polygon they are not accepted.
    Why is this ?
    Also we are looking for is a way to detect these lines before the polygons are created.
    thanks, Rene

    Hi,
    To detect the "lightning bolts" this procedure seems promising.
    Do a self intersect of the geometry.
    Determine de spatial relationship between the original and the self intersect.
    If the spatial relationship is not "EQUAL" you have you lightning.
    Here is a real life example:
    declare
    l_geo1 mdsys.sdo_geometry := mdsys.sdo_geometry(2002
    ,90112
    ,null
    ,mdsys.sdo_elem_info_array(1, 2, 1)
    ,mdsys.sdo_ordinate_array(258727.255
    ,472853.276
    ,258724.984
    ,472848.338
    ,258714.12
    ,472852.98
    ,258709.61
    ,472854.55
    ,258710.89
    ,472859.11
    ,258712.41
    ,472865.36
    ,258712.3
    ,472868.37
    ,258711.51
    ,472871.47
    ,258709.83
    ,472874.33
    ,258704.77
    ,472877.1
    ,258699.59
    ,472878.73
    ,258688.58
    ,472879.66
    ,258688.589
    ,472879.659));
    l_geo2 mdsys.sdo_geometry;
    l_result varchar2(100);
    l_tolerance number := 0.0005;
    begin
    l_geo2 := mdsys.sdo_geom.sdo_intersection(l_geo1, l_geo1, l_tolerance);
    l_result := sdo_geom.relate(l_geo1, 'mask=determine', l_geo2, l_tolerance);
    dbms_output.put_line(l_result);
    end;
    This example returns an unknown mask 100110001 which I believe should be a OVERLAPBDYDISJOINT. But it is definitely not an EQUAL.
    I will have to go and find some more examples to test this method.
    thanks Rene

  • Error  SDO_WITHIN_DISTANCE of a line string

    I am writing a number of queries for a prototype application. All of my queries are working except for when I try to find POINTS which are a certain distance from a line string.
    select
    poi.*
    from
    point_of_interest poi
    where
    SDO_WITHIN_DISTANCE(poi.location,
    SDO_GEOMETRY(2003,8307,null,
    SDO_ELEM_INFO_ARRAY(1,2,1),
    SDO_ORDINATE_ARRAY(45.0264,32.0082,44.998,32.0027,44.9858,32.0008,44.9797,32.0001)),'distance=5 unit=KM') = 'TRUE';
    The error I receive is
    ERROR at line 1:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13032: Invalid NULL SDO_GEOMETRY object
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 333
    The location fields in my table are points defined by
    SDO_GEOMETRY(2001,8307,SDO_POINT_TYPE(<longitude>,<latitude>,null),null,null)
    I can create a valid SDO_GEOMETRY on the line string. I only receive this error when I try to compare the points and line string with the SDO_WITHIN_DISTANCE.

    Oops, I finally see what I did wrong. My SDO_GTYPE was wrong 2003 should have been 2002.

  • Text Line separation involving different languages

    I am trying to make the transition from Pagemaker to CS2. I frequently have to make cards with strict external dimensions involving short lines of text in mixtures of English and Thai. Part of the reason why it is necessary to vary the distance between the lines is because the Thai Language uses tonal and punctuation marks above and below many of the consonents.
    How can I best adjust the distance betwen lines of text in CS2?
    thank you for your help

    You'll make things easier for yourself if you pick up a book about InDesign. The best for beginners is Sandee Cohen's Visual QuickStart Guides. They are available through Amazon for many versions of InDesign, including CS2:
    InDesign CS2 for Macintosh and Windows

  • How to create diagonal variable line pattern in CS6?

    Hi guys
    I'm on the brink of insanity with creating my diagonal line pattern. I've tried everything I can think of but the pattern is an absolute mess! I want to create a diagonal line pattern but I want the lines not to be uniform. Basically I've made a group of 3 lines and then one separate line on its own, then to repeat this as the picture below. I've used the distribute function so the distances between the lines is identical everywhere. I've then rotated the whole thing exactly 45 degrees and aligned the lines to fit the bounding box in the "make pattern" mode as shown. Yet the resulting pattern is just a mess of overlap ugliness. All I want is for the pattern to literally look as it does in the image on the left, can someone please tell me how to sucessfully do this in CS6?? Would be eternally grateful!!
    Desired pattern:               Result:

    Never create a line pattern at an angle. It's unnecessary.
    Create the pattern at 90° angles then use Object > Transform > Rotate and tick the "Transform Patterns" option and enter the angle you are after....
    Trying to get angled lines to match in a pattern can take considerable effort. Where as with this method you can create the pattern and rotate it in a matter of minutes. Let Illustrator work for you rather than against you. And, you can rotate to any angle so the pattern will function in multiple ways.

  • Line Following Mouse

    Hi
    Actually I already have a class that does this exact thing
    you can enjoy it here - http://megaswf.com/serve/1154775
    if you play around with it you will notice that the frame rate drops significantly when you move the mouse fast for a long time,
    especially if you add more objects and logic to the game (press space and see what happens )
    my question is how can I make this efficiant and not affect the frame rate.
    heres the code:
    package 
         import adobe.utils.ProductManager;
         import flash.display.DisplayObject;
         import flash.display.DisplayObjectContainer;
         import flash.display.MovieClip;
         import flash.display.Sprite;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.geom.Point;
          * @author Gadi G
         public class MouseHandler extends Sprite
              private  var _stage:DisplayObjectContainer;
              public var _bDraw:Boolean = false;
              private var _arrLine:Array = new Array();;
              private var _angle;
              private var _p1:Point =  new Point();
              private var _p2:Point = new Point();
              private var cos:Number;
              private var sin:Number;
              private var lineDrawing:Line;
              private var angle;
              private var distance:uint;
              private static var instance:MouseHandler;
              public var _mousePos:Point = new Point();
              public function MouseHandler()
              public static function getInstance():MouseHandler
                   if (instance == null)
                        instance = new MouseHandler();
                   return instance;
              public function startListening(prnt:DisplayObjectContainer)
                   _stage = prnt;
                   _stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
                   _stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
              private function mouseDownHandler(e:MouseEvent):void
                   _bDraw = true;
                   _p2.x = mouseX;
                   _p2.y = mouseY;
                   _stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
                   _stage.addEventListener(MouseEvent.MOUSE_MOVE, drawMouseLine);
              private function mouseUpHandler(e:MouseEvent):void
                   _bDraw = false;
                   _stage.removeEventListener(MouseEvent.MOUSE_MOVE, drawMouseLine);
              private function enterFrameHandler(e:Event):void
                   for each (var s:Line in _arrLine)
                        s.scaleX = s.scaleY *=  .79;
                        // the lowest possile value is one twip which is 0.05
                        if (s.width < .7)
                             _arrLine.splice(_arrLine.indexOf(s), 1);
                             _stage.removeChild(s);
                             s = null;
                   if (!_bDraw)
                        //_mousePos = null;
                        if (_arrLine.length == 0)
                             _stage.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
                   _mousePos.x = mouseX;
                   _mousePos.y = mouseY;
              private function drawMouseLine(e:MouseEvent):void
                   _p1.x = mouseX;
                   _p1.y = mouseY;
                   _angle = Math.atan2(_p1.y - _p2.y,_p1.x - _p2.x);
                   var rot:Number = (180 / Math.PI ) * _angle + 180;
                   cos = Math.cos(_angle);
                   sin = Math.sin(_angle);
                   distance = Math.round(Point.distance(_p1,_p2)) + 1;
                   while (--distance)
                        lineDrawing = new Line();
                        lineDrawing.x = _p2.x;
                        lineDrawing.y = _p2.y;
                        lineDrawing.rotation = rot;
                        _arrLine.push(_stage.addChild(lineDrawing));
                        lineDrawing = null;
                        _p2.x +=  cos;
                        _p2.y +=  sin;
                   _p2.x = _p1.x;
                   _p2.y = _p1.y;
    Thanks

    use:
    package 
         import adobe.utils.ProductManager;
         import flash.display.DisplayObject;
         import flash.display.DisplayObjectContainer;
         import flash.display.MovieClip;
         import flash.display.Sprite;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.geom.Point;
          * @author Gadi G
         public class MouseHandler extends Sprite
              private  var _stage:DisplayObjectContainer;
              public var _bDraw:Boolean = false;
              private var _arrLine:Array = new Array();;
              private var _angle;
              private var _p1:Point =  new Point();
              private var _p2:Point = new Point();
              private var cos:Number;
              private var sin:Number;
              private var lineDrawing:Line;
              private var angle;
              private var distance:uint;
              private static var instance:MouseHandler;
              public var _mousePos:Point = new Point();
              public function MouseHandler()
              public static function getInstance():MouseHandler
                   if (instance == null)
                        instance = new MouseHandler();
                   return instance;
              public function startListening(prnt:DisplayObjectContainer)
                   _stage = prnt;
                   _stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
                   _stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
              private function mouseDownHandler(e:MouseEvent):void
                   _bDraw = true;
                   _p2.x = mouseX;
                   _p2.y = mouseY;
                   _stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
                   _stage.addEventListener(MouseEvent.MOUSE_MOVE, drawMouseLine);
              private function mouseUpHandler(e:MouseEvent):void
                   _bDraw = false;
                   _stage.removeEventListener(MouseEvent.MOUSE_MOVE, drawMouseLine);
              private function enterFrameHandler(e:Event):void
                   for each (var i:int= _arrLine.length-1;i>=0;i--)
    var s:Line=_arrLine[i];
                         s.scaleX = s.scaleY *=  .79;
                        // the lowest possile value is one twip which is 0.05
                        if (s.width < .7)
                             _arrLine.splice(_arrLine.indexOf(s), 1);
                             _stage.removeChild(s);
                             s = null;
                   if (!_bDraw)
                        //_mousePos = null;
                        if (_arrLine.length == 0)
                             _stage.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
                   _mousePos.x = mouseX;
                   _mousePos.y = mouseY;
              private function drawMouseLine(e:MouseEvent):void
                   _p1.x = mouseX;
                   _p1.y = mouseY;
                   _angle = Math.atan2(_p1.y - _p2.y,_p1.x - _p2.x);
                   var rot:Number = (180 / Math.PI ) * _angle + 180;
                   cos = Math.cos(_angle);
                   sin = Math.sin(_angle);
                   distance = Math.round(Point.distance(_p1,_p2)) + 1;
                   while (--distance)
                        lineDrawing = new Line();
                        lineDrawing.x = _p2.x;
                        lineDrawing.y = _p2.y;
                        lineDrawing.rotation = rot;
    _stage.addChild(lineDrawing)
                        _arrLine.push(lineDrawing);
                        lineDrawing = null;
                        _p2.x +=  cos;
                        _p2.y +=  sin;
                   }                _p2.x = _p1.x;                _p2.y = _p1.y;           }      }   }
    Thanks

  • Densify straight line segments

    Hello All,
    I'm looking for a way to densify (add vertices at a specified interval) along a straight line segment. SDO_ARC_DENSIFY doesn't work as I need on straight line segments. Can anyone suggest a way to do this?
    I considered writing my own function as the logic seems simple, but I don't see a function to measure distances along a line w/o converting to LRS.
    Thanks!
    --john                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hi John,
    So what's the aversion to LRS? Licensing? The Oracle Spatial guide pretty much steps you through what you want to do here using LRS
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_lrs_ref.htm#autoId1
    They take a linestring, snap it into two pieces at measure 5 and then stick the pieces back together with the new point at the break. Just wrap up a CONVERT_TO_LRS_GEOM and CONVERT_TO_STD_GEOM on the way in and on the way out of your function. I assume you already know from what end you want to measure and that your linestrings run that way consistently.
    If you don't have the Spatial license then it's a bit more complicated. You need to walk the coordinates in the linestring adding up the distance and then figure out where your break point would land on the segment when you hit the desired measure. That's a fairly tall order for a forum request but perhaps other folks have some ideas for you. I would just use the LRS stuff myself so I've never thought through what it would take.
    Cheers,
    Paul

  • Adobe Form, Line Spacing of Paragraphs

    Dear colleagues.
    I have an Adobe Form (created by transaction SFP in
    an ERP 6.0 system, using Adobe LifeCycle Designer 7.1).
    This form contains a simple table to display some text in the form.
    The table has just one column for strings (type Text field, field
    format Plain Text only, value type Read Only).
    It works fine. However I would like to reduce the spacing of the text
    lines in the table.
    Would you please tell me how this can be done?
    (I tried the following, but it was NOT successful: I opened palette
    "Paragraph". Under "Spacing", the value of "Above:" and "Below:" was
    already 0pt. So I changed the option of "Line Spacing:" from "Single"
    to "Exactly" and assigned to "At:" a smaller value, e.g. 5pt.
    Then I tested my modified form, and I was very surprised: The
    spacing of the text lines did not change, but the width of the text
    lines was reduced! All letters were truncated: The above and below
    part of the letters disappear suddenly.)
    Would you please give me some hint?
    Best regards,
    Holger

    Hello Holger,
    could you please clarify that you have a table with one column and in each row you have some multi line text and you would like to reduce the distance between the lines or you have one line per row and wish to reduce the distance between the text in each row?
    --- Row 1 -----
    text line 1  
    <space>
    text line 2
    --- Row 2 -----
    text line 1
    <space>
    text line 2
    OR
    --- Row 1 -----
    text line 1
    <space>
    --- Row 2 -----
    <space>
    text line 2
    Regards,
    Ben Patterson

  • Including Line profile in an Imaq Script for a grey scale image.

    We are trying to include a line profile in a script so that we can assess
    the distance between the lines printed (as per attachment)in a grey scale
    image.
    Once the line profile is in the script we would then like to run a batch
    file on a series of images.
    Attachments:
    Test_1.JPG ‏67 KB

    It sounds like you are using Vision Builder or Vision Assistant (new name, same program).
    What you want to use is the Edge Detector. Use it to draw a line across your image, then adjust the parameters until all the edges are found. I reduced the contrast to 25 and it found all the edges.
    You can View Measurements under Tools to see the X and Y coordinates of each edge. You can also use batch processing and export the results. I didn't test it, but I assume if you export the results for the edge detection you will get the same list of points.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Only able to do one line of text  when creating a paragraph?

    Can only do one line of text. The carriage return/Enter key does not create a new line when building a paragraph? The cursor goes to the beginning or middle depending on how the justification is set.

    There are two things going on here. First, your leading, the distance between the lines, should be set to Auto or adjusted to the size you want. Second, if you click and drag out a text area before you type AE will automatically wrap the text to fill the area just as it does in Photoshop.
    I would start by clicking the little icon at the top right corner of the Character palette and then select Reset Character at the bottom of the list.

  • What line speed should I have (about)

    I understand there are many things that can change line speed. (Noise on line, Distance from exchange, line quality, internal wiring ect....)
    What sort of speeds 'should' i get with these router stats? My guess is around 3 to 4 Mbps
    Connection information
    Downstream
    1,408 Kbps
    Upstream
    448 Kbps
    ADSL settings
    Latency type
    Interleaved
    Noise margin (Down/Up)
    6.4 dB / 21.0 dB
    Line attenuation (Down/Up)
    49.0 dB / 27.0 dB
    Output power (Down/Up)
    15.8 dBm / 11.9 dBm
    Solved!
    Go to Solution.

    Nope. I have an old circular (with a weird finger tighten screw in the middle) box outside my house where 2 lines connect to from different parts of the house (Was done by the telephone company back in the 70's I think and The 2nd we don't use) and from there it goes into the attic and then down into the hallway into our main NTE5. I have no connection issues and sync at 8128kbps.
    That wouldn't explain your connection slowdown though because I believe if it's the box which is causing the problem then it will simply higher your attenuation as well as lowering your speed.
    Like this post? Give it a Star . If this post answers your question, please Mark it as the Accepted Solution.

  • Pixel coordinate​s along a ROI (line)

    Hi
    Problem: Calculating distance using "distance formula" for all the pixel points along a line on an image.
    I am grabbing images using a camera and then using "ROI line.vi" , to define a line as region of interest.For that I have to provide,initial and final coordinates of the line (pixels) , then I use ROI transform.vi to rotate this line about a point which is one of the ends of the line.This way I get a new line (ROI) and using "ROI to line" I get the pixel coordinates of two ends for the rotated line.
    Now I want to get the distance between two points on a line and for that I need the pixel cooridinates for the whole line.Does someone know how to get this ? or is there any better way of doing this?
    And yah I am using 100 pixels = 34.29 mm to convert pixel distance into mm.Is it correct ?
    Is it possible to switch on and off a bulb/electrical appliance using lab view ? Just want to try this out for fun ....
    Thanks a lot !
    Deepak
    LAB View 2010 SP1

    Hey Deepak,
    To answer your questions, I am assuming that you have the Vision Development Module installed, especially if you are using some of the Vision functions already (that you mentioned). Now, what I understand of what you are trying to do, it sounds like you already have the two endpoints of the line, and you want to get the pixel points in between to be able to make measurements on those. So if you already have the two end points of the line, then I would recommend you check out the following functions: IMAQ LineProfile.VI or IMAQ GetPixelLine.VI. The help documentation on these two will tell you more details about them, but basically you can get the values of the pixels on a line. Then once you have the other points and their values, you can do either use the IMAQ Caliper functions to measure distances on the line, or perform your own calculations using simple LabVIEW functions (like add, subtract, divide, etc.).
    You also mentioned something about converting pixel values to real world values. You can use the Calibration VI's in order to calibrate your image, and also use some of the other functions like IMAQ Convert Pixel to Real World.VI. If you don't want to use the Calibration functions, then you can perform your own conversion, again using simple LabVIEW functions.
    Last, for your question about switching on/off a light bulb or some other electrical appliance using LabVIEW, I would have to mention that LabVIEW can control electrical components, but usually with the help of some kind of hardware. Some hardware that I could think of would be some kind of electrical switch hooked up to a DAQ (data acquisition) board that can do either digital or analog output. Another option would be to use some 3rd party hardware and communicate with LabVIEW via some kind of protocol, such as serial, TCP/IP, modbus, Datasocket, etc. etc.There are numerous ways you can go about having LabVIEW control things via hardware.
    I hope these answers help. Please let me know if you need any clarification on anything. Thanks, and have a great day.
    Regards,
    DJ L.

  • In Pages 5.1 how do I change the default spacing after a paragraph? I used to be able to do this with the inspector. I no longer see the option.

    In pages 5.1 I was wondering how to change the line spacing after a paragraph.

    This is from the online Pages Help . You have the option to the Help in your Pages Help menu
    Adjust line spacing
    You can adjust the spacing between lines in a paragraph, and change the amount of space before or after a paragraph.
    Click in the paragraph whose spacing you want to change, or select one or more paragraphs.
    In the Text pane of the Format inspector, click Style.
    Click the disclosure triangle next to Spacing, then choose an option from the pop-up menu:
    Lines: Choose when the distance between ascenders (parts of letters that extend to the top of the line) and descenders (parts of letters that extend below the line) should stay the same. The space between lines is proportional to the font size.
    At least: Choose when the distance between lines should remain fixed (but not to overlap if the text gets large).The distance from one line to the next will never be less than the value you set, but it may be larger for larger fonts to prevent overlapping text lines.
    Exactly: The distance between the baselines.
    Between: The value you set increases the space between the lines, instead of increasing the height of the lines. By contrast, double-spacing doubles the height of each line.
    Click the arrows next to the spacing field to set the amount of space for the option you chose.
    To adjust the amount of space before and after the selected paragraph, click the arrows for Before Paragraph and After Paragraph

Maybe you are looking for

  • What is the replacement cost for iphone 5?

    My iphone 5 case is bent, and theres lines in the screen also the back cover is cracked up the top, will apple replace this for a fee? or do i need to buy a brand new phone? regards michael

  • Aperture 2.0 - Many Pictures now Seeing RED in lighted areas and BLUE

    Here's my problem, I just upgraded to Aperture 2.0 and many of my pictures now have bright lighted areas (like a light) showing up as RED in the viewer. I'm not sure if they will print this way, but I'm a bit concerned. I was able to go into the adju

  • How do I change google search to google chrome search engine

    need to have google search changed to google chrome search engine...attempted several times, several different ways...yet NO... will not happen... not a computer whiz... not at all...so please give simple instructions for me...I would appreciated it

  • THERE'S A NEW UPDATE FOR THE MY VERSION APP MOBILE BUT IT'S A LITTLE BUGGY

    Has anybody got this New Update if So i bet you are Having Fun with it:  As i am Currently now i had to Unistall it Several Times then Re-install it again to no Avail.  But i give it 1 time and it Finally Worked But the Widget is Jacked up!  An is no

  • Need programs related to Euro conversion

    Hi Moderator/ Friends I have checked in the SDN Network for the programs related to Euro conversion. I am unable to get these programs. Can you provide me path, where can I get programs need to be changed for Currency changeover from SKK to EURO for