Normal to a line drawn during execution (incorrect math)?

Hello.

I have an equation that apparently restores normal (line segments) up to a line drawn with ActionScript and the mouse.

If I posted less mouseX to a larger position mouseX it seems to work correctly.

line1Arr [i] .rotation = 45 * Math.atan2 (mouseYArr [i] - mouseYArr [i - 1], mouseXArr [i] - mouseXArr [i-1]);

line1Arr [i] is the instance of the normal line segment that is attached to the line and mouseXArr [i] and mouseXArr [i-1] is the most recent point and seizure.

The problem is that after doing a search on the web, I think that my calculations is not correct calculate normal.  I found a thread somewhere that mentions use derived from x and y for calculating normals.  Another soldier in the assigned thread, we can also use sine and cosine to calculate this.

It's the problematic equation I tried by going in the opposite direction mouseX

line1Arr [i] =(-45) .rotation * Math.atan2 (mouseXArr [i-1]-[i - 0] mouseXArr, mouseYArr [i - 1] - mouseYArr [i-0]);

Any help with this math problem is greatly appreciated.

because you are using a series of lines, there is no need to use trig: Cartesian geometry of base is sufficient.

for example, if you have an array of [x, y] points used in your drawing, calling normalsF will add perpendicular in the middle of these segments.  (for an example: http://www.kglad.com/Files/forums/normals.fla)

function normalsF (): void {}

for (var i = 0; i)<>

normalF(curveA[i],curveA[i+1]);

}

}

function normalF(p1:Array,p2:Array):void {}

m =-(p1[0]-p2[0]) /(p1[1]-p2[1]);

b = (p1 [1] + p2 [1]) / 2 - m * (p1 [0] + p2 [0]) / 2;

drawnormalF (m, b, [(p1[0]+p2[0])/2, (p1 [1] + p2 [1]) / 2]);

}

function drawnormalF(m:Number,b:Number,pt:Array):void {}

Len = Math.sqrt (400 /(4+4*m*m));

{with (curveParent.Graphics)}

moveTo (pt [0] - len, m *(pt[0]-len) + b);

lineTo (pt [0] + m *(pt[0]+len) + b, len);

}

}

Tags: Adobe Animate

Similar Questions

  • Filter the Table during execution and keep uncommitted line changes

    Hello

    I have a requirement which has been quite difficult for me so far.

    I use the first version Jdev 12 c.

    I have a table of AF that is connected to a ViewObject that is used for sending new data.

    When I add lines to this ViewObject, I put a field that I intend to use for filtering so that the number of lines is not displayed at the same time.  This field comes from a selection of LOV.

    I want to be able to change lines are displayed in the table based on what is the current value of selection LOV.  This isn't a problem for me, and it works perfectly using a view criteria and a variable transitional EO I put in place.

    My problem is that when I select a new value in the LOV and change to bind the variable view criteria, I want all changes uncommitted to the lines to be preserved in the View object.  Currently, the lines are not keep their changes, and I need to do this, because after that the user has entered data for a large number of lines, there will be a commit to the database for all new lines added.  Is this possible or should I look for an alternative?

    I also tried to use a table filter in the link of the page layer, but I get an error that I can't debug. It is marked as Houston-34014.  In this method, I try to access my bean in pageFlowScope to filter the table.  This bean variable is updated when the LOV selection changes.  Error messages settings are {0 = oracle.jbo.Key [-220-225], 1 = root}.  I also read that this filter parameter is a static filter and does not dynamically during execution.

    Any help would be appreciated, thanks for reading.

    Hello lhymel

    I think that your problem is solved, so please close this thread and open a new thread for tuning related problem

    Thank you

    -Ashish

  • Edit/delete/add scene coordinates in the table during execution

    Hello world

    I managed to build table allows you to store and record the coordinates of the stage and remind to control steps. However, I need change/remove/add details of scene during execution. I also need to allow the user to directly edit the coordinate from the scene of the array. Wondering what someone knows what is the best way to do it? Or is it better to use the matrix or Cluster? Thanks in advance.

    Best regards

    Han Yen

    Han Yen wrote:

    Thanks much altenbach for all the advice. I tried to do a table 2D control. I've been playing with table in the control. However, I still can't find out how can I detect that I change the data in the table 2D with the more recent issue during execution? How can I then update my current table with the latest data?

    Well, the 2D table is updated immediately and you do not all the other tables.

    Do you mean that you want to update XAbs, etc. where the just changed line is already selected?

    In any case, here's a simple project, perhaps it will give you some ideas. I would recommend using also the tables for XYZPos, entrances etc. and the XYZabs. This simplifies the code because you reduce the number of terminals and table operations.

    Let me know if something is not clear to you.

  • For a control that can be initilaized during execution

    In the case of an enumeration or a constatnt ring. The options to select should be listed when programming

    The option to select is possible during execution.

    I have a table, and I can send the 1st column of values in the menu drop-down, select one during execution.

    Help, please.

    Hi, Mike Grugh,.

    I don't know how to do it with a table drop-down list boxes, but if the number of lines in your file, then you can try the attached example.

    Kind regards

    Amine31

    (Give the congratulations to the right answers and Mark as a solution if your problem is resolved)

  • During execution of the backup and maintenance on one of my computers, I noticed a folder and the file that I can't identify me...

    Original title: identity of unknown folder

    During execution of the backup and maintenance on one of my computers (Windows xp home, sp3), I noticed a folder and the file that I can't identify.  The name of the folder is cc68f6b7a7ca948eefb018f001 and the name of the update.exe file.  The properties of the file that it is a Windows Service Pack installation.  I tried Googling the name of the folder, but found nothing.

    Can you tell me with regard to this issue, and what, if anything, I have to do?

    Thank you.

    When some programs (including Windows) installs things, it can create a temporary folder composed of 20-30 random letters and numbers or random numbers and letters in the root of the drive of the volume with more free space.

    This explains why the records are sometimes on your C drive or any other drive - the most space?

    For example, you can see a similar to or called folder:

    D:\9470bb12e8a4f3447657236478e41c5

    There may be other folders and files in this main temporary folder such as amd64 and i386 platforms.

    They should normally be deleted when the installation is complete, but sometimes they are not - especially if the installation fails.  They are harmless but annoying.  You can think something is wrong when there are no or fear, that the files are really necessary.  To avoid confusion, you can delete the temporary files.

    If your installation has failed or the installation does not remove the folder to the random name when it finishes running again installation will be another folder at the random name.

    You may be able to identify installation (out of curiosity) by looking at some of the contents of the folder and decide if this installation was not serious, just remove the files/folders.  If the installation does not work for some reason, run again just installation will create a new temporary folder to the random name so the old temporary folder is really useless.

    Records are sometimes tough to remove.  Even if you are an administrator on the system, you might get a "sharing violation", "access denied", "used" or type similar message when you try to delete temporary folders.  Facilities sometimes use different permissions that can have a regular user with the administrator group.

    There are many methods to try to remove the folders, and some require third party programs to install or change some windows settings that could compromise the security of your system if you do not change them back when you're done.

    Start your system in Mode safe mode (by pressing the F8 key several times just before XP attempts to load) is one good method to try to remove the files because it does not have to make any changes to your system configuration or by downloading third-party programs.

    If you are running XP Home Edition, the following section on turn off "Simple file sharing" does not apply to you since in XP Home, Simple file sharing is always turned on.  If you are running XP Home Edition, skip the next few paragraphs and resume where it says:

    "If no part tool above work try a third popular called Unlocker.

    If Safe Mode does not work you can change the security of the folder when you start in Normal Mode to give your username full control over the files by navigating to it in Solution Explorer, click on tools, Folder Options, view and in the advanced settings window, uncheck (at the bottom of the list) use simple file sharing (recommended) and click OK.  This disables him recommended simple file sharing on your computer if you want to turn it back on when you're done to make everything you do.

    Right-click on the files of interest, click Properties and click the now visible security tab.  Change the properties, but you need (for example, select your user name, and check the box to allow full control), click OK to apply the changes.

    With usage share of active simple files (recommended) the checked the properties of the folder tabs are:

    General, sharing, customize

    With the use of sharing files simple disabled (recommended) box unchecked, the properties of the folder tabs are:

    General, security, customize

    Now, try to manipulate/delete the folder.

    It's a good idea to go back to the Explorer and the cheque in the box easy to use sharing files (recommended) when you have finished making everything you do.

    If none of the above works, try a popular third-party tool called Unlocker.

    Unlocker can be downloaded here:

    http://www.emptyloop.com/Unlocker/

    If you use Unlocker, be sure to install because he wants to add a bunch of options, addons, shortcuts and other extras that you don't need.

    You must add the shell extension so when you right click on the offending file, you will have a Unlocker option to choose.  I would just install it long enough to clean up the leftovers and then, I usually just uninstall and all parts of it.  You can always install it again another day if you like.

    Unlocker can be uninstalled when you have finished using it.

    Reboot when finished to ensure that boring records are really missing.

  • Dynamic class loader during execution

    Hello

    1 as far I understand J2ME does not support the loader class API, and so the only way to dynamically load a class when running is to call Class.forName (). Is this correct? Is there another way around this?

    2 suppose I created a valid class file (' 'file:///SDCard/MyFiles/myClassFile.class ') during execution, if this file is located under the root of the SDCard, how I can call Class.forName and pass the name of the class file I just created? (The problem is that Class.forName expects a full qualified class name in the form: a.b.c.MyClassFile, while the file is physically located on the SD card.)

    Thank you

    Eyal

    Forget the class files. RIM has its own format of distrition with cod. Do not rely on the normal route, the java classes are stored.

    There is no "application" folder, you cannot add the classes here. Sorry

  • If Condition get spent during execution, even when the data Condition fails

    Hi gurus,

    We came back to condition in the procedure below


    / * Condition in a procedure * /.

    If i.effective_end_date > p_end_date and i.effective_start_date < = p_end_date

    then

    Start

    If l_future_rec_flag then

    -Call API with update insertion mode

    l_datetrack_mode: = hr_api.g_update_change_insert;

    on the other

    -Call API with Update Mode

    l_datetrack_mode: = hr_api.g_update;

    end if;

    -api call

    end;

    end if;

    / * Condition in a procedure * /.

    data sent to this if condition during execution is as below, I printed it using fnd_file.put_line (fnd_file.log).

    i.effective_end_date > p_end_date and i.effective_start_date < = p_end_date

    31 December 12 > 31 March 13 and 1 January 13 < = 31 March 13

    , my doubt is that the above data made it clear the if condition fails with past data. but during the execution, the condition happened and will block to start and run the api and get api error.

    Error occurred during the assignment process. Check the log file for more details. ORA-20001: unable to change the update of insert mode when there is no future lines

    Cause: The insert DateTrack change update mode can be done if there is no future lines after the current date.

    Action: Perform an update operation DateTrack or erase your changes.

    Error occurred during the assignment process. Check the log file for more details. ORA-20001: unable to change the update of insert mode when there is no future lines

    Can anyone help on this.

    Thanks in advance

    Hi gurus,

    Now, it has been resolved, we used the to_date for date comparison function and now it works perfectly.

  • How to hide the ADF table during execution

    Hi all

    I use Jdeveloper - 11.1.2.4.39.64.36.1 version

    Is it possible to show only the tables with associated in the same lines and hide tables with no record.

    For ex: Let's say that at the time of the design, there are three related data tables with the diagram below.

    Table 1
    Table 2
    Table 3

    However, during execution, there is no record for 'Table 2', but the table 1 and table 3 have records associated with them.

    Is it possible to hide the table 2 and get the following provision -

    Table 1
    Table 3

    According to the schema, table 2 should hide, and table 3 should get reordered under table 1 directly.

    Best regards

    Ankit Gupta

    Hello

    You can set the property visible from the table to something like #{bindings.. estimatedRowCount gt 0}

    Arun-

  • ORA - 06502:numeric or of value errORA-04088: error during execution of trigger

    I received the following error message by entering a number in the maximum value (i.e. 9 999 999.) allowed in a data entry form that is distinct from the basic form:

    ORA-06502: PL/SQL: digital or error number precision value: ORA-06512 too big: "< owner >. < trigger >", line 194 ORA-04088: error during execution of trigger '< owner >. < trigger >.

    Where < owner > is the schema name and < Trigger > is the name of the trigger. The block of data in the application for participation is based on a database table, and the sum of all the values entered (with a maximum value of 99.999.999.) appears in the form of Basic. A grand total of this amount along w / other totals on the basic shape is also displayed with a maximum value defined as 999 999 999. Only, I get the above error message when the total is greater than 99999999. If the total is less than or equal to 99.999.999, the basic form works very well. Why?

    I checked all the attributes of the database columns and form fields and everything seems to be okay, and I'm out of my mind. I desperately need your help to solve this problem quickly because the pressure is on...

    Thanks in advance for any help.

    Orchid says:
    Hello Hamid,

    Thanks for your help. Yes, it works as suggested, after that I have increased the length of NUMBER data base table column (9) to NUMBER (11).

    gives you the correct answer, and you don't mark it ;)

    >

    Apparently, Oracle database truncates the decimal points and only update the value of 9 digits without giving errors, but the form of Oracle application is more picky and it generates forms and Oracle error messages when you run the application. It seems that there is a difference when executing the sql commands in the Oracle database and execution of these Oracle Forms application controls. Do you agree?

    Yes

    Thanks again for all the help.

    You can only give reward for it by checking the useful and correct answer.

  • Compilation failed during execution: dsymutil

    Hello

    You try to compile a standard package for ios with major failure. The fast version works perfectly without any error.

    I am on mac os x lion and using flash builder 4.5.1. The error I get is:

    Error occurred during the application of packaging:

    /var/folders/N4/52v6ttx96c7bnw8vnysh5j780000gn/T/cmd460615453403880056.tmp: line 2: dsymutil: command not found
    Compilation failed during execution: dsymutil

    I can not find something posted previously or any where in fact.

    / Daniel

    I am answering my own question here.

    Install Xcode from the appstore (it's free) and you'll get dsymutil. Weird workaround plans can I run this installer on another computer that had no installed XCode (but still has dsymutil).  But at least it solved the problem.

  • ORA-04088: error during execution of trigger ' SYSTEM. SET_CURRENT_SCHEMA_PM'

    Hello
    10 g R2 on Win 2008 Server DBSNMP can not connect:
    sqlplus dbsnmp@MYDB
    
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Aug 18 07:35:19 2010
    
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    
    Enter password:
    ERROR:
    ORA-04088: error during execution of trigger 'SYSTEM.SET_CURRENT_SCHEMA_PM'
    ORA-01403: no data found
    ORA-06512: at line 5
    But I have:
    SQL> select username from dba_users where username like '%DBSNMP%';
    
    USERNAME
    ------------------------------
    DBSNMP
    
    SQL> grant connect to dbsnmp;
    
    Grant succeeded.
    What could be the problem?
    Thank you.

    First of all investigate what is this trigger as below

    select TEXT from dba_source
    where NAME='SET_CURRENT_SCHEMA_PM' and type='TRIGGER'
    and owner='SYSTEM'
    

    You can also disable this trigger, then try to connect again.

    alter trigger SYSTEM.SET_CURRENT_SCHEMA_PM disable
    
  • Can I change dynamically during execution Data Source?

    I need run the same reports on test environment and the production environment. How could I change source data during execution, according to the users want to run reports by querying the database test or production without amendment report definition?

    Hello

    what I would recommend in your case: set up your development/test systems as separate systems parallel to your production system. Clone your production environment for these development systems. Then a developer can login to the development system and run the reports (and modify it without touching the actual production system) and normal users work on the production system and only for validating them new developments, that they connect to the test system.

    It's a standard approach in software development and COMPUTER systems operations.

    How to watch your infrastructure, I have the impression that you have two databases and Server BI (prod and test)? Why not set up a test environment for the BI server, too?

    Best regards
    David.

  • masking steps during execution

    I have a sous-suite that I point the user to when asked to isolate a card failure.  To give them some flexibility, I got a popup that gives them a certain number of options (see attachment).  I have an m.o. that indicates the individual steps these select/run (i.e. '1' or '3' in the png).  Control flow (denoted by '2') is the noise they don't really need to worry and may / will cause confusion (and possibly problems for me if they select them accidentally).  Is there a way to hide these measures flow during execution control so that the user sees '1' and '2' (and other similar 'valid' selections?

    If there wasn't a need explicit to have the flow control logic, then I'd be tempted to compact all in the post of the Popup Message action.

    By setting the Popup Message Action to go to the step, , use Custom Condition (TRUE):

    And by using the following Expression:

    Step.Result.ButtonHit == 1? RunState.Sequence.Main ["MR_RPack_R55"]. UniqueStepId:
    Step.Result.ButtonHit == 2? "" "RunState.Sequence.Main ["End_PCI_Isolation"]." UniqueStepId:
    Step.Result.ButtonHit is 3? RunState.Sequence.Main ["MR_R103"]. UniqueStepId:
    Step.Result.ButtonHit is 4? "" "RunState.Sequence.Main ["PCI_Intf_PT"]." UniqueStepId: «»

    It should be appropriate level following the Popup Message.

    (SequenceFile attached).

    I hope this helps.

    Charlie

  • Why get error during execution the FPGA VI?

    Hello world

    I have a lot of sense of wrong during execution of a program that has been correctly executed previously. I don't know what I did wrong.

    Now, whenever I run this FPGA VI, I get an error (in the attachment). And, then runs the FPGA VI, but it does not give the data required those he supposed to give as output.

    Any help or recommendations would be appreciated also.

    Thank you.

    Hi auree123,

    There are a few reasons for this error
    may occur.  Could you tell us more about what's going on?

    You are
    I get this error when you compile and if so, at what stage?

    It looks like
    as you may be running it in Interactive Mode, which means that you are viewing
    the front of the FPGA VI on the development computer that you are running - is
    that correct?  If so, you could try to create a VI on your host
    Open a FPGA reference and communicate with the FPGA programmatically rather than interactively.

    Thank you

    Morgan S

    Technical sales engineer

  • button conrol min and max range option during execution

    Is it possible to change the window button conrol min and max Beach setting during execution?

    Thank you very much Nick.

Maybe you are looking for

  • Phone says searching

    Got the phone on with metroPCS, worked for a day, said the other research. Waited a week and decided to switch to cricket, switched to cricket, of course, it worked for a day and said the research, what is the problem?

  • How can I add a Web site to the popup blocker exceptions list by using a command prompt?

    I have a lot of users with Firefox 2. I need a specific web site to allow for pop-up windows if their Blocker is enabled. I need to be able to run this command in a script that runs from a command prompt when the user connects.

  • Yet WT8 - A - can not download pictures

    Hi all I'm just wondering if you can help me with this one please. I have a reminder of the Toshiba WT8 - A Tablet and I want to download pictures on my Toshiba Satellite laptop but the Tablet does not work as a media device and does not connect to t

  • HP 13 Stream: micro SDHC card format

    Does anyone know if it's better/more useful for the sd card format FAT32 or NTFS? I bought a 32 GB Kingston SDHC memory microSD which is formatted Fat32 for more storage space. Advice and guidance on the format that is more useful for that extra stor

  • Windows Mail does not read fonts properly

    as noted above, I have created a stationary and it worked very well so far, but now it does not show the same font as the saved file. I got Goudy Old Style, but in the mail it is italic, all the patches?