I want to create vectors at 45 degree angles to a line
I have the below classes for creating Vertices, Edges, and Midpoints of Edges on a canvas. I want to now create vectors at 45 degree angles to the edge at the midpoint. I have very little idea to do this at the moment. I would be very grateful if anyone could help.
public class Edge implements Serializable{
int edgeName;
Vertex first;
Vertex second;
Midpoint m;
double edgeLength;
public Edge(Vertex end, Vertex otherEnd, Midpoint crossing) {
this.first = end;
this.second = otherEnd;
this.m = crossing;
this.edgeLength= getEdgeLength();
public class Vertex implements Serializable{
//int name;
float xpos;
float ypos;
Vector vertexEdges;
public Vertex(//int ID,
float x, float y) {
//this.name = ID;
this.xpos = x;
this.ypos = y;
vertexEdges = new Vector();
public class Midpoint{
int first;
int second;
//controlPoint controlPoint;
public Midpoint(int x, int y) {
this.first = x;
this.second = y;
}
OK this is a shot in the dark but it makes sense.
Edge edge = new Edge()
public Vertex addDegreeAngleAtMidpoint(Edge edge, float degree, int lineLength){
//calculate the slope of the line ( (y2-y1) / (x2-x1 )
float slope = ((edge.secode.ypos - edge.first.ypos) / (edge.secode.xpos - edge.first.xpos)
//now you know the slope of the line then calculate x degrees from the line
//so the equation would be (cos degree = x/length) for the x value
float x = Math.cos(angle) * length;
//so the equation would be (sin degree = y/length) for the y value
float y = math.sin(angle) * length;
//calculate the slope of the vector ( (y2-y1) / (x2-x1 ) )
float vectSlope = (y - edge.midpoint.first) / (x = edge.midpoint.secode);
// get y intercept (y = mx+b => b = y -mx)
float yIntercept = y - vectSlope*x;
//get the point y = mx + yIntercept
// any point plugged into this equation shold be degrees offset from the midpoint of the line
// I did the hard part now you figure out the rest please.
}
Similar Messages
-
Want to create a certificate inline - i.e. not command line
Hi
How do you create a certificate inline (without using keytool)? Any links, examples?
ThanksIf (and only if) you can send the JDK file "tools.jar" with your app, you can create the certificate using exactly the same arguments as the keytool command. Just instantiate the Keytool class that`s present in tools.jar. You need to use reflection to instantiate an object of the class because the constructor is private.
If you can send the Bouncycastle provider with your app, you can try using Bouncycastle http://www.bouncycastle.org ). Sign the Bouncycastle mailing list as well. -
i want to create an input signal vector X(n) = [x(n) x(n-1) x(n-2).........x(n-N+1)
rashi wrote:
i want to create an input signal vector X(n) = [x(n) x(n-1) x(n-2).........x(n-N+1)
This question is quite ambiguous, because you don't really define anything, but you could try "array subset" and "reverse array".
Can you give an actual example of an input array and desired output?
LabVIEW Champion . Do more with less code and in less time . -
How to create vector portrait like the images as attached
i want to create these kind of portrait. How will I do ...
Pen tool to create the vector shapes and gradient mesh tool to make smooth transitions for the highlights and shadows. Illustrator doesn't have a function or tool that creates images like these.. Only the basic tools to create images like these. This question is kind of like what is the method to create an oil painting on canvas. you use a brush and paint to create the desired image..l
I Know that's not helpful but it's the answer.. Here's a decent start regarding how to begin vectorizing an image in this fashion..
http://m.youtube.com/watch?v=aiPAG5eCG20 -
Creating vector based outlines of text
There's a really great effect I'm trying to achieve where you take a shape and morph it into another shape, or often text.
There is a simple command in AE, like illustrator, where you simply "create outlines." AE also does a great job of taking one shape and morphing it into another just by keyframing the bezier points in shape one and then shape 2. It interpolates perfectly.
I've got pretty big challenges making this happen with Motion. Anyone know what I'm talking about and is there a way to do this I'm missing?
In other words, I want to be able to firstly turn text into vector points.
Secondly, I want to be able to copy points within a layer. Example, take 10 points from layer 2 and copy them into a pre-existing layer 1 rather than draw then having to take the preexisting layer 1 points and move them into the same shape as layer 2.
Can I copy control points like this?No....and....uh....no.
I'm afraid this is an area where Motion is far behind AE. Currently there is no way to create vector shapes with control points from text in Motion. There is also no built-in way to morph one vector shape into another although perhaps someone has developed a plug-in to do that.
There are a couple of tricks that you can do to fake it a bit, or certainly the manual way of morphing one vector shape into another, but nothing automated that I'm aware of.
Andy -
When one or more family members who have been sharing one iTunes account wants to create their own iTunes account can they each upload the music/apps from the shared iTunes on their devices to the new iTunes account?
Yes. I would clarify your statement about the "shared" iTunes Library though. If you want each iOS device to have its own music library, you should create separate user accounts for them. Read:
iTunes: How to share music between different accounts on a single computer
How to use multiple iPods, iPads, or iPhones with one computer -
My friend wanted to create a new iCloud account that was different to her iTunes and app one when she deleted her iCloud account that was the same as her iTunes it won't let her log into her iTunes one now what can I do to fix it she has paid or apps and songs and of she makes another account everything will be lost.
Need help please :) thanksAh thanks Razmee however there is NO option to delete the iCloud account in settings!
-
My brother and I have shared an account for five years, and now that I'm moving out, I want to create my own separate account but still want to be able to play the music I've purchased over five years.
In order to continue to play and sync the music you purchased with your old account, you'll need to authorize your new computer/iTunes library to do so. You can do this by choosing Store -> Authorize This Computer and then entering in your old account credentials.
That's all you should need to. Then just create your own account and start purchasing and using it the same you have with the old one.
B-rock -
Hopefully someone can help.... I have an Iphone 5 and want to create a music video playlist on my phone so then i can play through my apple tv... but when i make a playlist in itunes and try to add it over to my iphone it wont let me sync the playlist...? I have already added the music videos to my iphone so that is not the problem.... i cant seem to figure out how to make a playlist for them... IE: to make the videos play consecutively in the order i want without stopping after each video and gong back to the list.... this is what i have had to resort to make it work....what i want to do....is be able to make a playlist of videos on my iphone 5....take my apple tv to friends houses and with wifi....set up apple tv and play videos at the party and not have to stand by with the remote and find a new video to play stopping the music between the songs/videos....very annoying....and have spent over 4 hours one day and an hour and a half today on the phone today with a sr. advisor with apple and they have no clue.... this seems sooooo simple.... please somebody that really knows how to do this....i will be indebted forever...............
MikeThank you for replying. Yes I deleted the old email address..
-
I applied and received an upgrade code to Redeem Mountain Lion for my new MBP.
I get this message when I try to Sign in to the App Store after entering the redemption content code, and also if I just try to "Sign In". The first part of the error is true - I haven't used the AppleID with the iTunes store.
I received the upgrade code using this same AppleID, so I don't think I can use a different AppleID.
I also tried to re-create this appleID...(it was one suggestion I saw for this issue) It doesn't let me since the ID already exists...
The error is:
"This Apple ID has not yet been used with the iTunes Store. Please review your account information." I click "Review", next message "You must turn on cookies to continue. Cookies must be enabled if you want to create or edit.. etc."
It's clearly not a cookie issue.. Stuck...The first part of the error is true - I haven't used the AppleID with the iTunes store.
Try here > Using an existing Apple ID with the iTunes Store and Mac App Store
received the upgrade code using this same AppleID, so I don't think I can use a different AppleID.
Correct.
It's clearly not a cookie issue..
As for cookies. Quit the App Store. Now open the Finder. From the Finder menu bar click Go > Go to Folder.
Type this exactly as you see it here: ~/Library/Cookies
Click Go the move the com.apple.appstore.plist file from the Cookies folder to the Trash.
Relaunch the App Store. -
when i want to create a face time it tells me to vertify my email address. When i go to do this i have to type in my apple ID and password on the Apple website, however when ever i do this i get a message saying Invalid account for this Email Address..
Same problem here. Whats the deal?! Apple??
-
I want to create a Ajax based Chating application using java .
hi . I want to create an chating Application , and ajax based chatting application using java as my server side language ..i have some idea about it .. but one thing that i m not understanding is that how i will communicate with other users because each user has its own session so what i will do to send one messge to all the users ???? . i m new to JavaEE and i have chosen this as my semester project .. i need some help regarding this .
First get it working without AJAX.
-
Dear Sir / Madam,
First of all my english is not good enough and apologise for that. I want to create a kinda different java plug-in on mozilla . I ve been playin a textbase game for many years. However it takes many hours to play it manually. I d like to create a script for that and think script will work by itself (it will read 3d codes paste them automatically, it will click some words in website automatically etc.) I saw that one on your system its called "omerta rankscript". Could you tell me how i can start to do this and ? is it easy or how long time it takes to create a new plugin like this? also may i see the codes of this plug-in(omerta rankscript)?
Thank you for your consideration.
Best Regards,
Zafer ATABAYDepending on what you want to develop, you could consider an ''extension'' or a ''userscript''. A plugin probably is not the right type of add-on to create.
For suggestions and assistance with these different kinds of add-ons:
Extensions:
* http://forums.addons.mozilla.org/
* http://forums.mozillazine.org/viewforum.php?f=19
Userscripts:
* http://userscripts.org/forums
Good luck with your project. -
Hey guys ı really need your help. I bought macbook pro retina 15 inch 2 weeks ago and it came with installed mavericks of course but ı want to create a recovery disk and to do that ı need to download mavericks installer from app store but when i click to download mavericks from appstore purchased part ı get a message says " Your purchasing process couldnt complete. OS X Mavericks cant be installed to this computer." How can ı solve this problem!??
One way around tis is to borrow a Mac that can run Mavericks and then the download will work. You can use these instructions:
http://www.macworld.com/article/1167857/how_to_make_a_bootable_mountain_lion_ins tall_drive.html
Though they are for Mt. Lion, the same steps will work.
Ciao. -
I want to create tab's in JSP..?
Hello experts,
I want to create tab's in JSP page. So if there is in taglib for tab's. So please let me know which one is this and how to implement it. And the directory structure of the Application folder.
Thanks and Regards,
Andy SuryaOr you could write your own using divs and css, it wouldnt take very long as I have done it a couple of times. It might not be the best solution, but I made each tab section an action apart from the page you are currently on and used a separate jsp for each individual tab page. The html was replicated at the top of each page. Each clickable tab header had an action behind it fired by javascript.
It requires a page refresh on each tab click and multiple jsp's (one for each tab) so might not be the most appropriate solution but it works very well and looks good.
Maybe you are looking for
-
How to read/extract text from pdf
Respected All, I want to read/extract text from pdf. I tried using etymon but not succed. Could anyone will guide me in this. Thanks and regards, Ajay.
-
How do I get Firefox to automatically open to my igHome page
iGoogle is going away. I chose and registered for igHome to be my replacement. I want that homepage to open whenever I click on the Firefox symbol. How do I make that happen? Please be detailed in your answer. I'm not a computer geek! I have tried to
-
Question Mark in Quick Time Please Help :(
On certain websites, such as this one, when I try to play a video, a question mark appears over the quick time logo and it doesnt play the video. Ive searched for answers on here but I cant figure it out Thanks for the help
-
20+ years Should I stay, or should I go? THAT is the question! VZW?
It's up for grabs folks and I do not ask for much. I invite VZW to demonstrate just how much you value your customers, right here in this very public forum, and to do what it takes to keep this, among many, many others, very long standing, very loya
-
Has anyone actually done a factory reset on an Airport Express 802.11n?
Apple is telling me two ways to do a factory reset of the new Airport Express with "N" capability. One representative says that you hold the reset button while plugging in the AE and then 4 green flashes should occur and you release the reset button.