Search Results

Search found 5784 results on 232 pages for 'points'.

Page 13/232 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Drawing Quadratic Bezier circles with a given radius: how to determine control points

    - by Casey
    Just to clarify; the code below works, but I don't understand where the formula for the variable "controlRadius" comes from. I wrote this function by dissecting an example I found elsewhere, but I can't find any explanation and the original code comments were not able to be translated. Thanks in advance //returns an array of quadratic Bezier segments public static function generateCircularQuadraticBezierSegments(radius:Number, numControlPoints:uint, centerX:Number, centerY:Number):Array { var segments:Array = []; var arcLength:Number = 2 * Math.PI / numControlPoints; var controlRadius:Number; var segment:QuadraticBezierSegment; for (var i:int = 0; i < numControlPoints; i++) { var startX:Number = centerX + radius * Math.cos(arcLength * i); var startY:Number = centerY + radius * Math.sin(arcLength * i); //control radius formula //where does it come from, why does it work? controlRadius = radius / Math.cos(arcLength * .5); //the control point is plotted halfway between the arcLength and uses the control radius var controlX:Number = centerX + controlRadius * Math.cos(arcLength * (i + 1) - arcLength * .5); var controlY:Number = centerY + controlRadius * Math.sin(arcLength * (i + 1) - arcLength * .5); var endX:Number = centerX + radius * Math.cos(arcLength * (i + 1)); var endY:Number = centerY + radius * Math.sin(arcLength * (i + 1)); segment = new QuadraticBezierSegment(new Point(startX, startY), new Point(controlX, controlY), new Point(endX, endY)); segments.push(segment); } return segments; }

    Read the article

  • CruiseControl modificationSet fails to execute when svn points to a url

    - by Woot4Moo
    In my current CruiseControl setup I am running the following target: <modificationset quietperiod="30"> <svn RepositoryLocation="http://my/url/repo/trunk" /> </modificationset> I do a simple checkin of a blank text file and subsequently the messages I receive in the CruiseControl log are as follows: [cc]May-13 15:53:56 Project - Project mine: bootstrapping [cc]May-13 15:53:56 jectController- mine Controller: build progress event: bootstrapping [cc]May-13 15:53:56 Project - Project mine: checking for modifications [cc]May-13 15:53:56 jectController- mine Controller: build progress event: checking for modifications [cc]May-13 15:53:59 Project - Project mine: No modifications found, build not necessary. [cc]May-13 15:53:59 Project - Project mine: idle [cc]May-13 15:53:59 jectController- connectfour Controller: build progress event: idle [cc]May-13 15:53:59 Project - Project mine: next build in 1 minutes [cc]May-13 15:53:59 Project - Project mine: waiting for next time to build [cc]May-13 15:53:59 jectController- mine Controller: build progress event: waiting for next time to build Tortoise: TortoiseSVN 1.6.8, Build 19260 - 32 Bit , 2010/04/16 20:20:11 CruiseControl: 2.8.3

    Read the article

  • How to make gcc on SUN calculate floating points the same way as in Linux

    - by Marina
    I have a project where I have to perform some mathematics calculations with double variables. The problem is that I get different results on SUN Solaris 9 and Linux. There are a lot of ways (explained here and other forums) how to make Linux work as Sun, but not the other way around. I cannot touch the Linux code, so it is only SUN I can change. Is there any way to make SUN to behave as Linux? The code I run(compile with gcc on both systems): int hash_func(char *long_id) { double product, lnum, gold; while (*long_id) lnum = lnum * 10.0 + (*long_id++ - '0'); printf("lnum => %20.20f\n", lnum); lnum = lnum * 10.0E-8; printf("lnum => %20.20f\n", lnum); gold = 0.6125423371582974; product = lnum * gold; printf("product => %20.20f\n", product); ... } if the input is 339886769243483 the output in Linux: lnum => 339886769243**483**.00000000000000000000 lnum => 33988676.9243**4829473495483398** product => 20819503.600158**59827399253845** When on SUN: lnum => 339886769243483.00000000000000000000 lnum => 33988676.92434830218553543091 product = 20819503.600158**60199928283691** Note: The result is not always different, moreover most of the times it is the same. Just 10 15-digit numbers out of 60000 have this problem. Please help!!!

    Read the article

  • Manipulating and comparing floating points in java

    - by Praneeth
    In Java the floating point arithmetic is not represented precisely. For example following snippet of code float a = 1.2; float b= 3.0; float c = a * b; if(c == 3.6){ System.out.println("c is 3.6"); } else { System.out.println("c is not 3.6"); } actually prints "c is not 3.6". I'm not interested in precision beyond 3 decimals (#.###). How can I deal with this problem to multiply floats and compare them reliably? Thanks much

    Read the article

  • JavaScript (SVG drawing): Positioning x amount of points in an area

    - by Jack
    I'm using http://raphaeljs.com/ to try and draw multiple small circles. The problem I'm having is that the canvas has a fixed width, and if I want to draw, say, 1000 circles, they don't wrap onto a 'new line' (because you have to specify the xy position of each circle). E.g. I want this: .................................................. to look like this: ............................ ...................... At the moment I'm doing this: for ( var i = 0; i < 1000; i++ ) { var multiplier = i*3; if ( i <= 50 ) { paper.circle((2*multiplier),2,2); } else if ( i >= 51 && i <= 101 ) { paper.circle((2*multiplier) - 304,8,2); } else if ( i >= 152 && i <= 202 ) { paper.circle((2*multiplier) - 910,14,2); } } For reference: circle(x co-ord, y co-ord, radius) This is messy. I have to add an if statement for every new line I want. Must be a better way of doing it..?

    Read the article

  • plot matrix missing points in different color using gnuplot

    - by kitt
    I have a file 'matrix.dat': 1 2 3 4 5 5 - 3 4 5 - 4 5 B - 1 B 2 B 3 - 3 2 - 3 I want to plot numbers using palette, '-' using white color and 'B' using black color. In gnuplot, I use this palette (blue - cyan - green - orange - red): set palette model HSV functions 0.666*(1-gray), 1, 1 And set '-' as missing data: set datafile missing "-" plot 'matrix.dat' matrix with image Now I can only plot numbers and '-' in correct colors.

    Read the article

  • NoClassDefFoundError points to the wrong class.

    - by Sora
    I'm validating the installation of a program that consists of a few separate modules. They are not co-dependent. I have apple.jar and orange.jar, they are placed in the same folder and were developed in the same project, but run independent of each other. Running apple.jar goes fine, but orange.jar gives me a NoClassDefFoundError pointing to apple.jar. /usr/java/jre1.6.0_14/bin/java -jar validator.jar Exception in thread "main" java.lang.NoClassDefFoundError: orange/client/Apple Caused by: java.lang.ClassNotFoundException: orange.client.Apple at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) Could not find the main class: validator/client/StormDataXMLGenerator. Program will exit. The manifest file lists Orange as the correct main class. Main-Class: orange/client/Orange Anybody know why it's giving me the NoClassDefFoundError? Thanks in advance!

    Read the article

  • Javascript Regular expression to enforce 2 digits after decimal points

    - by Manas Saha
    I need to validate a text box where users are supposed to enter numeric values with 2 decimal places. I am validating the text in client side javascript. The validation will pass only if the number has precisely 2 decimal places, and there is at least 1 digit before the decimal point. (could be zero) the number before the decimal point can be 0, but can not be multiple zeroes. like 00 or 000 The number before the decimal point can not begin with more than 1 zero. Example of Passed validation: 0.01 0.12 111.23 1234.56 012345.67 123.00 0.00 Example of failed validation .12 1.1 0.0 00.00 1234. 1234.567 1234 00123.45 abcd.12 12a4.56 1234.5A I have tried with [0-9][.][0-9][0-9]$ But it is allowing alphabets before decimal point. like 12a4.56 Can anyone please fix the expression? thanks a lot in advance.

    Read the article

  • [Devise] confirmation_url points to localhost

    - by Ved
    I am using Devise and omniauth for authentication in my rails app. I have followed readme and put the following line in my production.rb : config.action_mailer.default_url_options = { :host => 'http://morning-autumn-487.heroku.com' } My mailer has the following code: <%= link_to 'Confirm my account',confirmation_url(@user, :confirmation_token => @user.confirmation_token) %> When I upload the app to heroku, the confirmation mail has the following link for registration in the email : http://127.0.0.1:3000/users/confirmation?confirmation_token=8TyGWQo6y... Is there a setting that governs this host name ?

    Read the article

  • drawing arrows on a line defined by a set of points( for tracking)

    - by sirvan
    hi i have a set of point which define a route. and i must draw their so vehicle moving arrow denoted. this ponit may be form a curve... i want to draw arrows on the reout to define witch arrow vehicle goes, i have a mapviewr java applet and the last i must to do is this work, i want to define arrows on every 10 point on the rout a thing like this

    Read the article

  • Interpolating data points in Excel

    - by Niels Basjes
    Hi, I'm sure this is the kind of problem other have solved many times before. A group of people are going to do measurements (Home energy usage to be exact). All of them will do that at different times and in different intervals. So what I'll get from each person is a set of {date, value} pairs where there are dates missing in the set. What I need is a complete set of {date, value} pairs where for each date withing the range a value is known (either measured or calculated). I expect that a simple linear interpolation would suffice for this project. If I assume that it must be done in Excel. What is the best way to interpolate in such a dataset (so I have a value for every day) ? Thanks. NOTE: When these datasets are complete I'll determine the slope (i.e. usage per day) and from that we can start doing home-to-home comparisons. ADDITIONAL INFO After first few suggestions: I do not want to manually figure out where the holes are in my measurement set (too many incomplete measurement sets!!). I'm looking for something (existing) automatic to do that for me. So if my input is {2009-06-01, 10} {2009-06-03, 20} {2009-06-06, 110} Then I expect to automatically get {2009-06-01, 10} {2009-06-02, 15} {2009-06-03, 20} {2009-06-04, 50} {2009-06-05, 80} {2009-06-06, 110} Yes, I can write software that does this. I am just hoping that someone already has a "ready to run" software (Excel) feature for this (rather generic) problem.

    Read the article

  • Google Visualization Annotated Time Line, removing data points.

    - by Vitaly Babiy
    I am trying to build a graph that will change resolution depending on how far you are zoomed in. Here is what it looks like when you are complete zoomed out. So this looks good so when I zoom in I get a higher resolution data and my graph looks like this: The problem is when I zoom out the higher resolution data does not get cleared out of the graph: The tables below the graphs are table display what is in the DataTable. This is what drawing code looks like. var g_graph = new google.visualization.AnnotatedTimeLine(document.getElementById('graph_div_json')); var table = new google.visualization.Table(document.getElementById('table_div_json')); function handleQueryResponse(response){ log("Drawing graph") var data = response.getDataTable() g_graph.draw(data, {allowRedraw:true, thickness:2, fill:50, scaleType:'maximized'}) table.draw(data, {allowRedraw:true}) } I am try to find a way for it to only displaying the data that is in the DataTable. I have tried removing the allowRedraw flag but then it breaks the zooming operation. Any help would be greatly appreciated. Thanks

    Read the article

  • $(MSBuildStartupDirectory) in Visual Studio points to different places on different machines

    - by skolima
    In a large solution, I'm integrating Gendarme into Visual Studio 2008 compilation process. I am using GendarmeMsBuild task along with a .targets file to add a AfterBuild target to every project in the solution. I am looking for a way to import this file into .csproj files in a way that wouldn't require me to change the include path (the projects have different nesting levels). Apart from using NuGet SolutionDir variable, best way to solve this seemed to be to use $(MSBuildStartupDirectory). However, as it turns out, on some machines, using the same version of VS 2008 (as same updates installed, as far as I was able to check) this resolves to the solution directory, and on others to c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE. How can I either get this to always resolve to the solution folder or obtain the base folder in another consistent way?

    Read the article

  • How do I keep a 3D model on the screen in OpenGL?

    - by NoobScratcher
    I'm trying to keep a 3D model on the screen by placing my glDrawElement functions inside the draw function with the declarations at the top of .cpp. When I render the model, the model attaches it self to the current vertex buffer object. This is because my whole graphical user interface is in 2D quads except the window frame. Is there a way to avoid this from happening? or any common causes of this? Creating the file object: int index = IndexAssigner(1, 1); //make a fileobject and store list and the index of that list in a c string ifstream file (list[index].c_str() ); //Make another string //string line; points.push_back(Point()); Point p; int face[4]; Model rendering code: int numfloats = 4; float* point=reinterpret_cast<float*>(&points[0]); int num_bytes=numfloats*sizeof(float); cout << "Size Of Point" << sizeof(Point) << endl; GLuint vertexbuffer; glGenVertexArrays(1, &vao[3]); glGenBuffers(1, &vertexbuffer); glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); glBufferData(GL_ARRAY_BUFFER, points.size()*sizeof(points), points.data(), GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, num_bytes, &points[0]); glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, points.size(), &points[0]); glEnableClientState(GL_INDEX_ARRAY); glIndexPointer(GL_FLOAT, faces.size(), faces.data()); glEnableVertexAttribArray(0); glDrawElements(GL_QUADS, points.size(), GL_UNSIGNED_INT, points.data()); glDrawElements(GL_QUADS, faces.size(), GL_UNSIGNED_INT, faces.data());

    Read the article

  • google maps plot route between two points

    - by amarsh-anand
    I have written this innocent javascript code, which lets the user create two markers and plot the route between them. It doesnt work, instead, it gives a weird error: Uncaught TypeError: Cannot read property 'ya' of undefined Can someone suggest me whats wrong here: // called upon a click GEvent.addListener(map, "click", function(overlay,point) { if (isCreateHeadPoint) { // add the head marker headMarker = new GMarker(point,{icon:redIcon,title:'Head'}); map.addOverlay(headMarker); isCreateHeadPoint = false; } else { // add the tail marker tailMarker = new GMarker(point,{icon:greenIcon,title:'Tail'}); map.addOverlay(tailMarker); isCreateHeadPoint = true; // create a path from head to tail direction.load("from:" + headMarker.getPoint().lat()+ ", " + headMarker.getPoint().lng()+ " to:" + tailMarker.getPoint().lat() + "," + tailMarker.getPoint().lng(), { getPolyline: true, getSteps: true }); // display the path map.addOverlay(direction.getPolyline()); } });

    Read the article

  • java and mysql geting shortest path from to two points

    - by shaharnakash
    hi i have a mysql database that hold id ,name , oneid , twoid , size 1 1 1 2 4 2 2 1 3 1 3 3 2 1 74 4 4 2 4 2 5 5 2 5 12 6 6 4 2 12 7 7 4 6 74 8 8 4 7 12 9 9 3 5 32 10 10 3 8 22 11 11 5 3 66 12 12 5 6 76 13 13 5 9 33 14 14 6 10 11 15 15 6 7 21 16 16 8 3 12 17 17 8 9 10 18 18 9 8 2 19 19 9 10 72 20 20 10 6 31 21 21 10 7 7 22 22 10 9 18 23 23 7 6 8 i want to do Dijkstra algorithm but i cant get the details right if i got the contents to class Conn id ,name , oneid , twoid , size how do i find the path from oneid 1 to twoid 7 and believe me i triad many Dijkstra algorithms so please dont give me only reference

    Read the article

  • Javascript function objects, this keyword points to wrong object

    - by Rody van Sambeek
    I've got a problem concerning the javascript "this" keyword when used within a javascript functional object. I want to be able to create an object for handling a Modal popup (JQuery UI Dialog). The object is called CreateItemModal. Which i want to be able to instantiate and pass some config settings. One of the config settings. When the show method is called, the dialog will be shown, but the cancel button is not functioning because the this refers to the DOM object instead of the CreateItemModal object. How can I fix this, or is there a better approach to put seperate behaviour in seperate "classes" or "objects". I've tried several approaches, including passing the "this" object into the events, but this does not feel like a clean solution. See (simplified) code below: function CreateItemModal(config) { // initialize some variables including $wrapper }; CreateItemModal.prototype.show = function() { this.$wrapper.dialog({ buttons: { // this crashes because this is not the current object here Cancel: this.close } }); }; CreateItemModal.prototype.close = function() { this.config.$wrapper.dialog('close'); };

    Read the article

  • Extracting data points from a matrix and saving them in different matrixes in MATLAB

    - by Hossein
    Hi, I have a 2D Matrix consisting of some coordinates as below(example): Data(X,Y): 45.987543423,5.35000964 52.987544223,5,98765234 Also I have an array consisting of some integers =0 , for example: Cluster(M) 2,0,3,1 each of these numbers in this array corresponds with a row of my 2D Matrix above.For example, it says that row one(coordinate) in the Data Matirx belongs to the cluster 2,second row belongs to cluster 0 and so on. Now I want to have each of the datapoint of each cluster in a separate matrix, for example I want to save datapoints belonging to cluster 1 in a separate matrix, cluster 2 in a separate matrix and so on,.... I can do them manually, but the problem is this has to be an automatic extraction. which means that the number of clusters(range of the numbers in the cluster array varies in each run) so I have to have a general algorithm that does this extraction for me. Can someone help me please? thanks

    Read the article

  • Please clarify a few points concerning Java Servlets

    - by EugeneP
    suppose, I use Tomcat as a web container. Is it true that once all the servlets found in a web-app/WEBAPPNAME are init(IALIZED) then every change of a Servlet's property will be seen to every session. So session 1 changes a property userName of a Servlet1 from "user1" to "user2" session 1 is closed. session 2 starts. It will see "user2" as the only value of Servlet1.userName property?? Any change of a Servlet's field will be seen to all subsequent sessions? Are servlets singletons, aren't they?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >