Half way pixel between two pixels

hi there guys,
i'm new in this forum
i'm working on this aLife simulation and i need to find co-ordinates of a pixel between two others on an image.
so, pixel A(x1,y1) and pixel B(x2,y2) and suppose there's a line between them
i would need the pixel C(x3,y3) that lies in the exact middle of the distance between these two pixels
i have a function that determines the distance between them but no way of finding out what that half way pixel is
please help cause this is somewhat urgent
thanks in advance for your time

I am sorry, but I took programming in college. What you are asking for is the distance equation, which you should have learned in high school algebra. That equation is simply as follows:
d = sqrt((x2 - x1)^2 + (y2-y1)^2)
where:
"sqrt" means take the square root
d is the distance between the points
The points are (x1,y1) and (x2,y2)
"^2" means to square that portion of the equation
When you are doing a line in a 3-dimensional space, the distance equation becomes the following:
d = sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2)
where:
the points are (x1,y1,z1) and (x2,y2,z2)
This is a basic computer programming problem, and if you need to ask on a forum like this for help, maybe you should consider changing majors. (I am not trying to be cruel, but let's face it, there are much more difficult problems you will be presented with in your studies than this one. It does not matter whether you are writing this code with JAI, or without, or with Java, C++, Fortran, COBOL, Perl, or any other language. The logic is the same for this calculation regardless of languages and/or libraries used.)

Similar Messages

  • 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

  • IPhone 5 screen has visible gap between vertical pixel columns...

    Hi, i might be nitpicking the issue but my new iPhone 5 (White) has a visible gap between each pixel colum (vertical only). Ever since the iPhone 4 came out I was amazed by how "sharp" everything looked and even the smallest text would barely be very crisp and legible. We have two iPhone 5's in the family and the newest one built week 21 of 2013 has this annoying visible vertical gap. It's mostly noticable on solid lighter colors. The older 4 & 5 phones are as crisp as always. I've shown it to several people and they have been able to spot the difference. Has anyone else noticed this? I've checked out a few display models at the Apple Store and half of them seem to be like mine, the other half are not. I'm thinking the ones that are like mine must all be fitted with the same display supplier or there might be a video chip issue of some sort. Any help would be appreciated. Thank you.

    No , it's common at least I got this issue. I just replaced my iphone due to power butto failure and now I my replacement unt exactly like what ts stated. When you stare on the screen it's quite hard to notice, it's visible when move your eyes or the phone left right. It's very clear on grey and blue color.
    I think it's not screen defective but lower cost LCD vendor , I got this kind of issue on my replacement dell LCD too( Samsung ) then I straight ask for lg screen which is same brand as original and no such problem.
    Btw I will still ask for replacement from apple

  • Any way to see sharp pixels in a bitmap close-up?

    Is there a way turn off antialias for a particular object (bitmap)?
    I want to fly the camera close to an image and see sharp edged pixels rather than a blur. Can this be done?

    Not really, but what makes you think antialiasing is active on this item?
    All you're doing when you scale or get closer to a bitmap is make the limited number of pixels into bigger pixels. It is not possible to create more pixels in Motion. go back to the source image's creation applciation and scale it up 200-400% and bring it back into Motion. You just need to make sure you aren't simply making the pixels bigger in the host application. You must find a way to create more pixels.
    bogiesan

  • Is there a way to share my Mail account and settings between two partitions, running Snow Leopard and Lion?

    I have two partitions on my internal hard drive - one is running Mac OS X 10.6 Snow Leopard and the other is running Mac OS X 10.7 Lion. Mail (5.0) is set up and runs perfectly on the Lion partition and I have not used Mail (4.5) yet on my Snow Leopard partition. I want to know if I can read, download, and save mail into the same user Library folder (probably the Lion user library) from both partitions...

    You usually set up your mail accounts on a specific e-mail client programs such as Mail in OS X and Mail on an iPad, which will access the same remote mail server to have your messages show up on each device. Mailboxes can be synced in this way between two devices.
    An alternative is to use the same remote application such as Gmail to access that service from multiple devices, so a dedicated e-mail client like Mail is not needed, but the availability of these depends on the e-mail service being used.

  • Is there a way to delete text between two strings?

    In Pages, is there a way to delete all text containted between two strings?
    For example, if I have a text document that looks like this:
    String 1
    String 2
    Unwanted text
    Unwanted text
    String 3
    String 4
    Is there was to delete the unwanted text between string 2 and 3 so it looks like this:
    String 1
    String 2
    String 3
    String 4
    The unwanted text is differnet between documents but string 2 and 3 are constant. I want to do this via automator for the same strings on multiple documents.
    Any help is appreciated!

    Do you mean Pages '09 v4.3?
    There were some links here:
    https://discussions.apple.com/message/24051199#24051199
    Peter

  • Different ways to copy data between two schemas in one instance

    Hi there,
    I am searching a good way to copy data between two schemas in the same instance.
    Both schemas have an identical structure such as triggers, tables, views and so on. The only difference is the purpose: one is the productivity system and one is for development.
    I looked at datapump but I do not explicit want to export / import. I want to keep the data in the productivity schema as well as copy it to the other schema. Any ideas? I found out there is a copy statement but I dont't know how that works.
    Thank you so far,
    Jörn

    Thank you for your replies!
    I also thought of creating a second instance for development and move the dev - schema to it. I just don't know whether our server can handle both (performance?). Anyway the idea is to have a possibility to quickly rebuild the data inside a schema without indixes or triggers, just pure data. I thought the easiest way would be to copy the data between the schemas as they are exactly the same. However if you tell me DataPunp is the best solution i won't deny using it :).
    When you export data a file is created. does that also mean that the exported data is deleted inside the schema?
    best regards
    Jörn
    Ps: Guido, you are following me, aren' t you? ;-)

  • I tried to open a folder in my Documents. It does not show in any window but does show up when I am half way between windows. It did the same thing when I tried to empty the trash. It asked if that was what I wanted but I could't say yes because it was or

    I tried to open a folder in my Documents. It does not show in any window but does show up when I am half way between windows. It did the same thing when I tried to empty the trash. It asked if that was what I wanted but I could't say yes because it was or

    what is your question/issue here? did the folder have any content in it to begin with? screen shots of what you may be seeing?
    if english isn't your native language, write it in what you are most comfortable speaking in to describe your issue.

  • I want to know what for is the "Sync" button in Lightning and if there is a way to sync my LOCAL Lightning calendars between two computers. Thanks

    I want to know what for is the "Sync" button in Lightning and if there is a way to sync my LOCAL Lightning calendars between two computers. Thanks

    sync is about synchronizing network calendars. Simply create a network calendar and synchronize it on multiple machines and forget local calendars.

  • What is the best way to get a ratio between two waveforms?

    I'm reading in multiple channels on a PCI 6143 and I want to get the Voltage Standing Wave Ratio (VSWR) between two channels. Right now I have a choice of outputting a 2D DBL or 1D waveform from the daqmx read vi. With the 2D DBL I can use a For Loop and an Index array and compare channels that way, but I was wondering if there is a better function to compare waveforms or even a function to calculate VSWR. Using the For Loop and Index array seems inefficient.

    The PCI-6143 does sample all channels simultaneously (unlike some other DAQ boards), so you should not get any phase differences there. That leaves hardware. You need to make sure your cable lengths are the same and your splitter has the same impedance/path in both directions. You can compensate for splitter problems with cable length or software realignment. You can do a visual check of the waveforms to see if you have a problem. With the frequencies you are likely to measure with the 6143 (10s of kHz), you probably don't need to worry. This is usually only a problem at MHz frequencies.
    You are correct that you do not want to use Express VIs in RT. However, you can use an Express VI to save you a lot of time. Set up the Express VI to do what you want to do, then open the front panel. Cut and paste the code from the block diagram to your RT code, then modify it to make it more efficient. This can often save you a lot of work.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Getting a pixel between thumbnail images

    Hi Folks
    I am using a CellRenderer to display thumbnail images,and I want to
    keep a distance of 1 pixel between the images.
    What can I do to get this?
    Attached is my renderer
    public FTRDPictureChooserDateAndTimeCellRenderer(){
         thumbnailImage    = new JLabel();
         imageText         = new JLabel();
         dateAndTimeLabel  = new JLabel();
         gbl = new GridBagLayout();
         setLayout(gbl);
         gbc = new GridBagConstraints();
         gbc.gridx      = 0;       // x represents cols
         gbc.gridy      = 0;       // y represents rows
         gbc.gridwidth  = 1;               // reset to the default
         gbc.gridheight = 2;       // span 2 rows to display image.
         gbc.weighty    = 1.0;
         gbc.weightx    = 1.0;
         add(thumbnailImage,gbc);
         /* Image Name */
         gbc.gridwidth  = GridBagConstraints.REMAINDER; //end row
         gbc.gridheight = 1;     
         gbc.gridx      = 1;          
         gbc.gridy      = 0;
            add(imageText,gbc);                                                      
         setOpaque(true);
                                                                          

    Well, let's see... now if I look at the API docs for
    GridBagConstraints, I see it has fields: ipadx and
    ipady ... I wonder what they do?They pad inside the component so won't actually help. However, the insets field will allow you to define the number of pixels to pad outside the component. So you can either do gbc.insets = new Insets(0,0,0,1) from the first component or gbc.insets = new Insets(0,1,0,0) for the second one. Either will add a single pixel between them.
    Ian

  • HT1338 Macbook pro two days old...bought logic from app store...logic has installed partly each time i open it up it wants to download rest of programme then stops half way thru and gets error message 'logic is unable to continue with download' help neede

    Macbook pro two days old...bought logic from app store...logic has installed partly each time i open it up it wants to download rest of programme then stops half way thru and gets error message 'logic is unable to continue with download' help needed !

    Hello:
    I would trot back into the Apple store and have them fix the problem (or call Applecare with a warranty issue).  There is no sense in you wasting your time trying to troubleshoot things on a new computer.
    Barry

  • I cant upgrade my new ipad to the ios6 dont knkow why and whats the problem and i was alo trying to   do the update simolteniously for infinity blade which i stoped in between as it crashed the ios upgrade   once hence tryed it again it went half way but

    i cant upgrade my new ipad to the ios6 dont knkow why and whats the problem and i was alo trying to
    do the update simolteniously for infinity blade which i stoped in between as it crashed the ios upgrade
    once hence tryed it again it went half way but it didnt work at all and i am trying to do it from the
    India..

    bnjr86 wrote:  There have been times when I've walked in there, that I really don't want to deal with VZW anymore and just take my business elsewhere.
    I  wonder if another provider would really be much different?  Read some of the other carrier forums - seems to be the same story everywhere.
    I'm not disagreeing with you - I've found that I am usually more informed about Verizon policies and procedures than some of the reps in our local store.

  • I'd like to print an 8x12 and cut it in half to make two 4x12 panorama type pictures.  Is there any way to combine two pictures (each cropped to 4x12) into one frame so I can print out the 8x12 and trim it after printing?

    I'd like to print an 8x12 and cut it in half to make two 4x12 panorama type pictures.  Is there any way to combine two pictures (each cropped to 4x12) into one frame so I can print out the 8x12 and trim it after printing?

    To clarify, I want to be able to make a flie I can take to a photo printing place (not for my own printer) so they can print it and I crop it.  The place I used to print at used to print an 8"x12" for the same price as 8"x10" (now they may only do 8x10 and I would need to keep the ratio the same so it would be two 3.3"x10" pics on an 8x10").  Any help is veryappreciated!

  • Is there a way to sync past messages from my old iPhone to my iPhone 5 ? I'm aware of the iTunes backup syncing but how would I transfer that between two devices ?

    Is there a way to sync past messages from my old iPhone to my iPhone 5 ? I'm aware of the iTunes backup syncing but how would I transfer that between two devices ?

    Restore from old iPhone backup can past all data including messages to your new iPhone. Or you can resfer to this iPhone 4/4S SMS to iPhone 5 transfer tutorial. It shows you how to transfer messages only.

Maybe you are looking for

  • NSU status

    Is Nokia a fan of chocolate eggs? I'm unable to get NSU to connect to nokia for updates over my broadband connection, I cannot check for updates from my phone over UMTS, and this site is *very* slow. Too much chocolate perhaps? Seriously though.. is

  • Can't burn CDs in Lion 10.7.2

    Message says Canceling burn. This is after it collects the titles in the playlist. I tested this and have discovered that if the playlist spans more than 1 CD, iTunes will cancel the burn without even trying to determine how much to write to the CD.

  • "Edit Content" feature not working

    A bit of background: I own and operate a meal planning service. I use a combination of MS Office (Word, Power Point, and Excel) and Acrobat XI Pro to create my meal plans. I create the template designs in MS Office, then I convert them to PDF in Acro

  • Is there a way to dispaly a query running on a hierarchy in form of Flat st

    Hello Good People, Is there a way to dispaly a query running on a hierarchy in form of Flat structure. That is, I want the hierarchy nodes to be placed in different columns than having them in rows. Thanks Simmi

  • My iphone could not be restored. an unknown error occurred (37)

    Can anyone help me? I just updated my software. I was going to restore and update my Iphone 4 to the latest software. Upon finishing, they pop-out " IPhone could not be restored. An unknown error occured (37)." I tried to restore my Iphone again and